What built-in PHP functions are useful for web scraping? What are some good resources (web or print) for getting up to speed on web scraping with PHP?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Scraper class from my framework:
file_get_contents()
can take a remote URL and give you the source. You can then use regular expressions (with the Perl-compatible functions) to grab what you need.Out of curiosity, what are you trying to scrape?
The curl library allows you to download web pages. You should look into regular expressions for doing the scraping.
Nice PHP web scraping ebook here:
https://leanpub.com/web-scraping
I'd either use libcurl or Perl's LWP (libwww for perl). Is there a libwww for php?
There is a Book "Webbots, Spiders, and Screen Scrapers: A Guide to Developing Internet Agents with PHP/CURL" on this topic - see a review here
PHP-Architect covered it in a well written article in the December 2007 Issue by Matthew Turland