摘要:
import requests from bs4 import BeautifulSoup import traceback import re def getHTMLText(url,code='utf-8'): try: r = requests.get(url,timeout=30) r.en 阅读全文
摘要:
import requests import re def getHTMLText(url): try: kv = { 'cookie': '', #要换成自己网页的cookie 'user-agent':'Mozilla/5.0' # 请求头;指定访问浏览器为Mozilla5.0版本的浏览器 } 阅读全文