Last active
June 13, 2016 13:07
-
-
Save i5on9i/13330f390719543cb0ad795ea1fd0936 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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