Page 1 of 1

getting source of a page into a variable

Posted: Mon Aug 22, 2005 2:04 am
by electronicrow
Hi everybody!!!

I want to get the source of a page into a variable:

Please use this url as an example:(It is important for me to get the source but esspecially this page)

http://v3.espacenet.com/results?sf=a&FI ... &=&=&=&=&=
(THE PAGE EXISTS YOU CAN TRY!!!)

Anyone who believes that it can not be get , pls give a logical reason

take it easy!

Posted: Mon Aug 22, 2005 2:13 am
by vigge89
file_get_contents() can be used for this.

Code: Select all

<?php
$url = 'http://v3.espacenet.com/results?sf=a&FIRST=1&CY=ep&LG=en&DB=EPODOC&TI=ocular+delivery&AB=&PN=&AP=&PR=&PD=&PA=&IN=&EC=&IC=&=&=&=&=&=';
$contents = file_get_contents ($url);
echo $contents;
?>

It didn't work

Posted: Mon Aug 22, 2005 2:18 am
by electronicrow
My friend did you try it?(If you didn't pls try!)
It doesn't work on my computer!
Do I have to fix something?

take it easy!

Posted: Mon Aug 22, 2005 5:51 am
by timvw
If my browser can get the page, so can my script. Meaby, their script is look at a User-Agent header string or whatever, which you have to simulate...

Might want to search for "get amazon" on this forum, as we've mentionned a couple of workarounds for this problem.

viewtopic.php?t=36211

Posted: Mon Aug 22, 2005 7:50 am
by electronicrow
Thank you very very very much :) !!!