Skip to content

Instantly share code, notes, and snippets.

@i5on9i
Last active June 13, 2016 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save i5on9i/13330f390719543cb0ad795ea1fd0936 to your computer and use it in GitHub Desktop.
Save i5on9i/13330f390719543cb0ad795ea1fd0936 to your computer and use it in GitHub Desktop.
import requests
from pyquery import PyQuery
headers = {
'user-agent': "Mozilla/5.0 (Windows NT 6.1) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/50.0.2661.87 Safari/537.36"
}
baseUrl = "http://google.com"
params = {'c': 26, 'p': 1}
r = requests.get(url=baseUrl, headers=headers, params=params)
if r.status_code == requests.codes.ok:
pq = PyQuery(result.content)
pubDate = pq.find('.date').html()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment