![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
爬虫
DeathandBreath
这个作者很懒,什么都没留下…
展开
-
爬虫感悟2
import requests from requests.exceptions import RequestException import re import json def getHTMLText(url): try: response = requests.get(url, headers={'user-agent': 'Mozilla/5.0'})原创 2017-10-24 11:20:31 · 497 阅读 · 0 评论 -
爬虫感悟1
import requests from bs4 import BeautifulSoup def getHTMLText(url): r = requests.get(url) r.raise_for_status() r.encoding = r.apparent_encoding return r.text def getUnivList原创 2017-10-21 20:27:19 · 439 阅读 · 0 评论 -
爬虫感悟3
path = 'C:\Users\Desktop\photo' 在代码中写这个得到的结果总是: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape 上网查了别人的回到会明白了合适 \ u 的转义的问题,所以找不到这个原创 2017-11-14 23:42:00 · 557 阅读 · 0 评论