问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
import urllib
import urllib.request
import re
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
}
url = "https://search.51job.com/list/000000,000000,0000,00,9,99,python,2,1.html?lang=c&stype=&postchannel=0000&workyear=99&cotype=99°reefrom=99&jobterm=99&companysize=99&providesalary=99&lonlat=0%2C0&radius=-1&ord_field=0&confirmdate=9&fromType=&dibiaoid=0&address=&line=&specialarea=00&from=&welfare=%22
req=urllib.request.Request(url,headers=headers)
response=urllib.request.urlopen(req)
html=response.read().decode('gbk')
print(html)
jobnum_re = '
jobnum_comp=re.compile(jobnum_re,re.S)
jobnums=jobnum_comp.findall(html)
print(jobnums[0])