[Solved] Scraping web pages with Python vs PHP? [closed]


In my opinion, I would go with python, because of its excellent string handling capabilities compared to PHP. Also there are a lot of cool libraries that python has , that make Scraping web pages a bliss.

Some libraries you should check out are :

Beautiful soup

Scrappy

I have personally used BeautifulSoup and its simple and really powerful.

Checkout this piece of code from their documentation :

import urllib2
from BeautifulSoup import BeautifulSoup

page = urllib2.urlopen("http://www.icc-ccs.org/prc/piracyreport.php")
soup = BeautifulSoup(page)
for incident in soup('td', width="90%"):
    where, linebreak, what = incident.contents[:3]
    print where.strip()
    print what.strip()
    print

1

solved Scraping web pages with Python vs PHP? [closed]