-
Notifications
You must be signed in to change notification settings - Fork 97
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
Refactor distributor modules to classes #262
Conversation
Goals are: - Add stateful user-agent and cookie handling in fake_browser - Scrape parts in distrtibutor then part order - Use a class inheritance approach to distributor modules, this allows adding state information and reduces the amount of variabled passed around. - One scraping thread per distributor, simplify locking Implemented in this commit: - Used class approach to distributors and fake_browser - Parts are scraped in distributor -> part order - One (IO limited) python thread per distributor - Simplified locking
…"Connection: close" http header.
…how up correctly.
…crape_part argument count.
We still have to checking the Digikey module/class (I don't now if this is issue act in the others class). |
@hildogjr The digikey issue should be fixed with my last commit. |
Understood the change. But not fixed yet, I am debug and understanding the changes now. |
I spoke to soon... with the last commit I get During handling of the above exception, another exception occurred: Traceback (most recent call last): Commit 5a90494 works but not for Digikey |
removed unneccessary non-logger debug print in kicost.py.
@hildogjr The cause of the digikey error was that digikey detected and banned the scraper. I implemented a user-agent switch in fake_browser if KiCost is detected. This solves the digikey error and future related errors. @anderwm I could not reproduce your error. Does this still happen with the latest version? If yes, please run KiCost with the |
This commit finishes the refactoring.
I am closing all the issue fix with this new branch and do some procedure to full features tests and merge. From 558 Digikey parts, just missed 2: "5001" ("36-5001-ND") and "A-DS 09 PP/Z". |
Founded the source of the issue using the level 8 debug: |
@hildogjr The trailing space bug was already there before the refactoring. It was added by |
I will check this minor issues before release on PyPi. |
Refactoring as discussed in issue #242. All regressions should be fixed by now.
Random samples from the
tests
directory (test2.xml, test3.xml, Decoder.xml) work without errors.This closes issues #242, #174, #215