lithromantic696
2022-06-25 00:38
采纳率: 0%
浏览 40

大一爬虫不出结果,求解答

有没有厉害的指点一下,为什么我的爬虫没有结果(跟着b站上做的,做到一半发现不出结果)代码:
import requests
import parsel

url = 'https://www.maoyan.com/board/1?timeStamp=1656087791410&channelId=40011&index=1&signKey=ef317f48d8bdcac1f6156d593ea448&sVersion=1&webdriver=false%27
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36'}

response = requests.get(url=url, headers=headers)
html_data = response.text
#print(type(html_data))

parse = parsel.Selector(html_data)
dds = parse.css('.board-wrapper dd')
for dd in dds:
name = dd.css('.name a::attr(title)').get()
print(name)
结果:
C:\ProgramData\Anaconda3\python.exe C:/Users/xxx(姓名)/PycharmProjects/pythonProject4/main.py

进程已结束,退出代码0

我去看了状态码确定是200

2条回答 默认 最新

相关推荐 更多相似问题