Skip to content

Instantly share code, notes, and snippets.

@swshan
Created May 9, 2016 07:29
Show Gist options
  • Save swshan/813b00daf19efa717fa2a930126a4137 to your computer and use it in GitHub Desktop.
Save swshan/813b00daf19efa717fa2a930126a4137 to your computer and use it in GitHub Desktop.
#coding=utf-8
import urllib2
from bs4 import BeautifulSoup
def get(url):
req=urllib2.Request(url)
req.add_header("User-Agent","Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)")
req.add_header("Referer",url)
req.add_header("Cookie","jyean=flVZbRitNuOM44i3VjCPjP93MgxEj24GZ8yvM6fZ9HM4MfiQXQP6_eTlsA1lvSOqypz4l1Dj8OV4X-1xEwkoKZ6P1SyGgiNtNxi3n50-q6H_cTMs3jTa8oHBA47MLuyU0; JYE_FP2=58f1a56e5f3cea7fd10be747461acba5; CNZZDATA2018550=cnzz_eid%3D562178188-1448873225-http%253A%252F%252Fwww.jyeoo.com%252F%26ntime%3D1448873225")
html = urllib2.urlopen(req)
doc = html.read()
print doc
html.close()
return doc
if __name__ == "__main__":
url = 'http://www.jyeoo.com/math3/ques/partialques?q=a7b3c3f4-60c7-4d77-8bbb-3ed17d240b0b~b68f0dc4-be3f-40df-89ec-00126ff8e9d8~&f=0&tk=0&ct=0&dg=0&fg=0&po=0&pd=1&pi=1'
get(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment