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

解决selenium偶尔抓不到element的问题 #26

Open
Superskyyy opened this issue Apr 25, 2019 · 1 comment
Open

解决selenium偶尔抓不到element的问题 #26

Superskyyy opened this issue Apr 25, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@Superskyyy
Copy link
Owner

  • 思路1

selenium获取到cookie,然后用其他框架爬

  • 思路2

用selenium往页面嵌js,做预处理(√)

  • 思路3

写一个更高级的脚本系统来引导python

@Superskyyy Superskyyy added the bug Something isn't working label Apr 25, 2019
@Superskyyy
Copy link
Owner Author

A workaround is skipping both that is "UNSP" -- indicates a blank stub course. and <Title> contains a "***" -- indicates the course has multiple offerings. These will be the only two types of courses observed so far, which goes against the overall structure.

The further solution will be adapting thought 2 into code. After all, selenium is the safest way to do such scraping, due to its nature of mimicking human inputs from an actual browser. We also need to add random delays between each page call, preventing IP/ account bans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant