Re: how do i fetch some text

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



chintan wrote:
how do i fetch some text from a webpage for some generated field?
like i want to fetch a score line from a sport site in which the line says "score"? actually i want to fetch an IP from my ISP's page which displays it with my user name.

where is the DB in this question? (probably you would get better response
on the php-generals list.)

what you want to do sounds quite involved, if you want your script to grab
the same page as you see in your browser then you will probably
have to use something like the cURL extension or use a shell cmd like 'wget'
in order that you can spoof UserAgent headers, pass login info, send a
valid cookie along with the request.
once you have the page you will have use some code to 'scrape' out the data you want,
a suitable regular expression is the first thing that springs to mind inconjunction
with preg_match() - but there are lots of other ways, php is abounds with
string searching and manipulation function (time to dig into the manual :-)

you might also want to search for the term 'screen scraping' or variations
in order to get a better understanding of how to go about it.

maybe there is a much easier way to do what you want.
in order to find out answer the following 2 questions, maybe it will
help someone to offer a totally different solution:

1. what is the relevance of the IP address, to what does it belong?
2. why do you need this IP? what is your end goal?

rgds,
Jochem



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux