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

Various small fixes and improvements (in preparation for some bigger changes) #50

Merged
merged 15 commits into from
May 8, 2021

Conversation

rocketinventor
Copy link
Contributor

Made many small changes to better follow code best practices.

Improves code quality, style, and performance. Fixes a few small bugs, and better catches some errors. Follows instructions from selenium-wire to make chromedriver less detectable when using undetected-chromedriver (if the selenium-wire package gets updated).

New Captcha Behaviour and dependencies
"Fixes" the code to be compliant with PEP-8 standards.

Includes removing unused variables (and imports), splitting up and
replacing import statements (no more import *), fixing all lines to be
no longer than 79 characters, minor syntax fixes, etc.
Added some labels and new types of files to ignore (related to chromedriver)
Catch and log all errors. Do a generic system exit.
When displayed with a smaller window size, the categories menu is ofen not visible, causing errors.

This change catches the chromedriver error and deploys a workaround.
Will only display one warning if not found, not 2+
Switched cookiebanner code to use WebDriverWait instead of time.sleep. Now waits up to 3 seconds for the element to display (but can be less).
Added some more info, fixed some inaccuracies, typos, and spacing issues
Follows recommendation of the "undetected-chromedriver" and "selenium-wire" packages to make chromedriver less detectable.

https://pypi.org/project/selenium-wire/#bot-detection
Changed text to be more relevant with current program flow
Reverts accidental changes to the book_reader_url that accidentally broke it.
@rocketinventor rocketinventor mentioned this pull request May 6, 2021
@leoncvlt
Copy link
Owner

leoncvlt commented May 7, 2021

Sorry for not looking at this sooner - real-life work has been quite hectic 😛 I'll give it a proper look this weekend!

@leoncvlt leoncvlt merged commit 605a090 into leoncvlt:master May 8, 2021
Iskendro pushed a commit to Iskendro/blinkist-scraper that referenced this pull request Mar 20, 2022
Various small fixes and improvements (in preparation for some bigger changes)
Iskendro pushed a commit to Iskendro/blinkist-scraper that referenced this pull request Mar 20, 2022
Various small fixes and improvements (in preparation for some bigger changes)
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

Successfully merging this pull request may close these issues.

2 participants