santhoshse7en / news-fetch

A Python Package which helps to scrape all news details from any news websites
MIT License
179 stars 109 forks source link

ImportError: cannot import name 'get_chrome_web_driver' from 'newsfetch.helpers' #93

Closed zk2 closed 3 years ago

zk2 commented 3 years ago

`Python 3.9.1 (default, Dec 13 2020, 11:55:53) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

from newsfetch.google import google_search Traceback (most recent call last): File "", line 1, in File "/home/zeka/ZEKA/pythonProjects/news-fetch/newsfetch/google.py", line 1, in from newsfetch.helpers import (get_chrome_web_driver, get_web_driver_options, ImportError: cannot import name 'get_chrome_web_driver' from 'newsfetch.helpers' (/home/zeka/ZEKA/pythonProjects/news-fetch/newsfetch/helpers.py) from newsfetch.news import newspaper news = newspaper('https://www.bbc.co.uk/news/world-48810070') File "", line 1 news = newspaper('https://www.bbc.co.uk/news/world-48810070') IndentationError: unexpected indent from newsfetch.google import google_search Traceback (most recent call last): File "", line 1, in File "/home/zeka/ZEKA/pythonProjects/news-fetch/newsfetch/google.py", line 1, in from newsfetch.helpers import (get_chrome_web_driver, get_web_driver_options, ImportError: cannot import name 'get_chrome_web_driver' from 'newsfetch.helpers' (/home/zeka/ZEKA/pythonProjects/news-fetch/newsfetch/helpers.py) `

I could not find get_chrome_web_driver, get_web_driver_options, set_automation_as_head_less, set_browser_as_incognito, set_ignore_certificate_error in the newsfetch.helpers

santhoshse7en commented 3 years ago

I have updated the package please check once. I am using this package for chrome driver selenium purpose https://pypi.org/project/chromedriver-binary-auto/

new version - https://pypi.org/project/news-fetch/

zk2 commented 3 years ago

google.py from newsfetch.helpers import (get_chrome_web_driver, get_web_driver_options, set_automation_as_head_less, set_browser_as_incognito, set_ignore_certificate_error) I can't see where get_chrome_web_driver and other function are defined helpers.py doesn't contains them

santhoshse7en commented 3 years ago

Thanks for pointing it out. I have now added the function in helpers. Remember I have just made a simple version of the google search page scraper if more requests noted. Google will throw a captcha. The only thing we can do to solve the captcha uses VPN.

Install the latest version - https://pypi.org/project/news-fetch/

This package includes chromedriver-binary, please try to install chromedriver-binary that matches your current chrome browser version