Open ciroiriarte opened 4 years ago
@ciroiriarte I originally wrote this program to be out of the box compatible with windows. I did not test it on linux however it should be pretty simple to change things over. Looking at you error it is in the web_to_pdf function. The way this function works is it instructs chrome to accesses a previously created offline html page in the current run directory. So you should just need to change line 90 self.driver.get("%s/web.html" % current_dir)
to use the linux equivalent directory structure such as this self.driver.get("file://%s/web.html" % current_dir)
I tested this on my own debian based distro and it worked as intended. Let me know if you have any further issues.
Thanks for the suggestion, did that change and now it doesn't blow-up but the resulting PDF only mentions a file not found error page:
And now my account seems to be locked. Probably that's the culprit, will see how to enable the account and try again.
Oh I see the error. On line 80 f = open('.\web.html', 'wb')
needs to be changed to f = open('./web.html', 'wb')
Will check, probably os.path.sep can be of help to improve the code.
Hello!,
eagerly wanting this to work :)
I've tested with openSUSE 15.1, with these packages:
chromedriver-84.0.4147.135-lp151.2.120.1.x86_64 google-chrome-stable-85.0.4183.83-1.x86_64 python3-selenium-3.11.0-lp151.2.2.x86_64
VitalSource Webscraper... Please enter your desired webpage: https://bookshelf.vitalsource.com/#/books/XXXX Please enter your username: myuser Please enter your password: dfsafa Loging in.... Scraping Webpage... Converting data into usable form... Printing content to PDF... Traceback (most recent call last): File "web_scraper.py", line 103, in
run.scrape_page()
File "web_scraper.py", line 65, in scrape_page
self.source_to_web(book_source)
File "web_scraper.py", line 84, in source_to_web
self.web_to_pdf()
File "web_scraper.py", line 90, in web_to_pdf
self.driver.get("%s/web.html" % current_dir)
File "/usr/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 324, in get
self.execute(Command.GET, {'url': url})
File "/usr/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
self.error_handler.check_response(response)
File "/usr/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument
(Session info: chrome=84.0.4147.135)