I have a small script which calls up a remote dynamically generated webpage, ( examines the resulting HTML code line by line to extract certain information from it that I want to use. (No, I'm not extracting e-mail addresses, but that would be the same sort of thing).
I cycle through a number of calls to the main body of the script, changing the variable "whatever" from a list. The script works fine sometimes, but usually it's on to the next iteration before the first web page has finished arriving. As a result, the information I want hasn't arrived yet, and my script never gets the info I want.
The question is, how can I make the script wait for the entire remotely generated page to arrive before it tries to go through the result line by line? I have tried $file=fopen("$remotefile" while (!feof($file) {}. I have also tried $line=file($remotefile). Neither of them ends up getting the full file most of the time. I can tell this is the problem because I echoed the file line by line and could see where it cut off the first page and called the next iteration.
Help greatly appreciated.
Roy
I cycle through a number of calls to the main body of the script, changing the variable "whatever" from a list. The script works fine sometimes, but usually it's on to the next iteration before the first web page has finished arriving. As a result, the information I want hasn't arrived yet, and my script never gets the info I want.
The question is, how can I make the script wait for the entire remotely generated page to arrive before it tries to go through the result line by line? I have tried $file=fopen("$remotefile" while (!feof($file) {}. I have also tried $line=file($remotefile). Neither of them ends up getting the full file most of the time. I can tell this is the problem because I echoed the file line by line and could see where it cut off the first page and called the next iteration.
Help greatly appreciated.
Roy