import requests
from webcrawler import crawlerJd

r=requests.get("http://www.baidu.com")
print(r.status_code)
r.encoding="utf-8"
print(r.text)
crawlerJd.pa()

def getHTMLText(url):
    try:
        r=requests.get(url)
        r.raise_for_status()#如果状态不是200，引发HTTPError异常
        r.encoding=r.apparent_encoding
        return r.text
    except:
        return "产生异常"

