Sean_Boothby
Sean_Boothby

Reputation: 177

Python Selenium with Chromedriver Detected

Having an issue signing in to the soundcloud website when using selenium with chromedriver. Selenium is detected before I can even log in.

Hoping to find a solution to this, so that I can lightly automate the use of soundcloud.

I have done hex editing of chromedriver to change the $cdc_ variables to random letters, thinking that this would make me less likely to get detected. I have also implemented proxy servers. Obviously the proxy IP that I put in the code example is not the actual IP for what I am using.

Note that once I get to the soundcloud page I am manually logging in, but I still get a message that says 'Our robots think you are a robot. Try reloading the page...'

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.options import Options


proxy = '0.0.0.0:0'
seleniumproxy = '--proxy-server={}'.format(proxy)
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument(seleniumproxy)
chrome_options.add_argument('disable-infobars')
chrome_options.add_argument('--disable-extensions')
driver = webdriver.Chrome(chrome_options=chrome_options)
driver.get('https://soundcloud.com/')

Just hoping to be able to get my script to login. I was not able to find the usage of a distil network in the dom. That said I am not super proficient in reading JS or anything so I could have easily missed it.

Upvotes: 1

Views: 1339

Answers (1)

Yun
Yun

Reputation: 1042

You want to avoid detection right?

Try to add below code into your script.

I have tested your code and sign in successfully.

# set developer mode 
chrome_options.add_experimental_option('excludeSwitches', ['enable-automation'])

Upvotes: 3

Related Questions