NITDgpOS / Medium_Grabber

This is an automated program that lets you grab the link of any article under any topic just by logging into your Google linked medium account.
MIT License
12 stars 19 forks source link

Updated the script to work with chrome. #18

Closed AniruddhaChattopadhyay closed 5 years ago

AniruddhaChattopadhyay commented 5 years ago

What this Pull request does is: 1) update the script to run chrome in headless mode. Whether chrome or firefox will be run is in accordance to the users choice.

2)update the readme instruction accordingly

3)Give more concise details in the user.txt and pass.txt file as to whats to be done there.

AniruddhaChattopadhyay commented 5 years ago

Actually I did some research on working with headless chrome. There I fond out that to run headless chrome in windows we need to use '--disable-gpu'. This is not necessary in linux distros but since the script is meant for both windows and linux I included the option. I could have put it under an if platform.system()=='Windows' but it will work fine just as it is so that is the way I did, And for the experiment option I read somewhere in stackoverflow that if you ever want to make an '.exe' file out of the script then this experiment arguments help. I can remove it if you want me to. I am attaching a relevant screenshot.

On Thu, Dec 6, 2018 at 10:06 AM Abhishek Singh notifications@github.com wrote:

@ZER-0-NE commented on this pull request.

In Grab_that_article_on_Medium.py https://github.com/NITDgpOS/Medium_Grabber/pull/18#discussion_r239325702 :

  • print( """Choose the browser you want to use:(Enter the appropriate number)\n
  • 1---> firefox \n
  • 2---> chrome \n
  • 0--->exit""")
  • choice = int(input())
  • if choice==1:
  • options = Options()
  • options.headless = True
  • driver = webdriver.Firefox(options=options)
  • break
  • elif choice==2:
  • options = webdriver.ChromeOptions()
  • options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors"])
  • options.add_argument('--disable-gpu')
  • options.add_argument('--headless')

Are these arguments necessary? And that experimental option?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NITDgpOS/Medium_Grabber/pull/18#pullrequestreview-182080786, or mute the thread https://github.com/notifications/unsubscribe-auth/AgR7ffAYU2K2zYEOqd4EX2CoMjv-1KoOks5u2J7AgaJpZM4ZFddF .