3 ms·
Thanks to pip I often don't even bother with the Python stdlib for crusty things like one-off web scrapes or XML parsing. Here's a recent example where I wante
by dpritchett 14y ago
Thanks to pip I often don't even bother with the Python stdlib for crusty things like one-off web scrapes or XML parsing. Here's a recent example where I wanted to read some attributes out of some remote XML and did it with requests and PyQuery rather than urllib and xml:
_domains_text = requests.get(API_URL + "/domainlist.xml").content
_domains_db = pyquery.PyQuery(_domains_text)
DOMAINS = [d.values()[0] for d in _domains_db('domain')]
- RegEx 14y agoI like to set jQuery = pyquery.PyQuery(someHTMLDocumentString) So I can use jQuery like I'm used to. At this point, you can do links = jQuery('a') or whatever.