|
from bs4 import BeautifulSoup
import requests
headers = {
'User-Agent':'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1'
}
url = 'https://www.tripadvisor.cn/Attracti**-g60763-Activities-New_York_City_New_York.html#ATTRACTION_SORT_WRAPPER'
mb_data = requests.get(url,headers=headers)
soup = BeautifulSoup(mb_data.text,'lxml')
print(soup)
按照教学视频操作的代码但是爬取不了每次运行代码显示的结果就是:E:\python\python37\python.exe E:/python/四周py实战/Plan-for-combating-master/week1/1_3/1_3code_of_video/3_Trip_Advisor.pyProcess finished with exit code 0
|
|