Question about Selenium and Chrome WebDriver

Jersey321

Newbie
Joined
May 6, 2019
Messages
7
Reaction score
0
Hello,
My question refers to the following topic:

https://www.blackhatworld.com/seo/guide-how-ad-networks-and-everyone-else-knows-youre-a-bot.1119582/

Everything seems easy to understand and do up to the point where an author says:

Below is a ultra-lite Python script that will open up a automated browser and will send it to Google. Python comes pre-installed with Mac computers if you want to try it for yourself, but you will have to download the Chrome WebDriver to get it to work.

from selenium import webdriver

browser = webdriver.Chrome(executable_path='chromedriver.exe')
brower.get('http://www.google.com')


If you were using an automated browser, then open up developer tools / console and type in "navigator.webdriver", the response will be true.



I have Google Chrome, I downloaded Selenium and I downloaded ChromeDriver from http://chromedriver.chromium.org/home - it simply opens as a command window (cmd) with 5 lines of text and doesnt allow me to do anything.

Where do I have to input the following code?

from selenium import webdriver

browser = webdriver.Chrome(executable_path='chromedriver.exe')
brower.get('http://www.google.com')


Sorry if I seem stupid for you BHW pros out there, I am just new and willing to learn.
Thanks!
 
Hello,
My question refers to the following topic:

https://www.blackhatworld.com/seo/guide-how-ad-networks-and-everyone-else-knows-youre-a-bot.1119582/

Everything seems easy to understand and do up to the point where an author says:

Below is a ultra-lite Python script that will open up a automated browser and will send it to Google. Python comes pre-installed with Mac computers if you want to try it for yourself, but you will have to download the Chrome WebDriver to get it to work.

from selenium import webdriver

browser = webdriver.Chrome(executable_path='chromedriver.exe')
brower.get('http://www.google.com')


If you were using an automated browser, then open up developer tools / console and type in "navigator.webdriver", the response will be true.



I have Google Chrome, I downloaded Selenium and I downloaded ChromeDriver from http://chromedriver.chromium.org/home - it simply opens as a command window (cmd) with 5 lines of text and doesnt allow me to do anything.

Where do I have to input the following code?

from selenium import webdriver

browser = webdriver.Chrome(executable_path='chromedriver.exe')
brower.get('http://www.google.com')


Sorry if I seem stupid for you BHW pros out there, I am just new and willing to learn.
Thanks!

You'll need to install Python first. (When installing make sure to check off the box to make a Path for python)
Also download PyCharm.
Once you do that go into your cmd and install selenium using this command: "pip install selenium" without the "" marks.
Go to the chromedriver website and download the driver.
Open up Pycharm, make a new project, make a new python document, and put that script into it.
Hit run and it should work.

Here's a youtube video that explains it all step-by-step:

It even explains that exact script you mentioned above.
 
Back
Top