Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第33课——用Python解析HTML页面中代码错误 #63

Open
WhaleLep opened this issue Dec 6, 2024 · 3 comments
Open

第33课——用Python解析HTML页面中代码错误 #63

WhaleLep opened this issue Dec 6, 2024 · 3 comments

Comments

@WhaleLep
Copy link

WhaleLep commented Dec 6, 2024

用 XPath 解析方式改写之前获取豆瓣电影 Top250的代码中:
rank_spans = tree.xpath('//[@id="content"]/div/div[1]/ol/li[1]/div/div[2]/div[2]/div/span[2]')
应该改为:
rank_spans = tree.xpath('//
[@id="content"]/div/div[1]/ol/li/div/div[2]/div[2]/div/span[2]')

@hbjcstkl2020
Copy link

hbjcstkl2020 commented Dec 6, 2024 via email

@b11152
Copy link

b11152 commented Dec 6, 2024 via email

@CHAMPIOM1
Copy link

CHAMPIOM1 commented Dec 6, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants