简体   繁体   中英

Automate SoundCloud using selenium python

I'm learning how to automate websites using selenium but getting 'NoneType' Error.

selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().install())
driver = driver.get("https://soundcloud.com/")

When I try to focus the search Bar get "NoneType Error"

NoneType 错误图像

Xpath copy chrome Developer Tool 在此处输入图像描述

driver = driver.get("https://soundcloud.com/")

Problem is here you have assign driver.get() in a variable which is again driver and which is having no attribute find_element_by_xpath()

Just change this. It will navigate to webpage.

driver.get("https://soundcloud.com/")
driver.find_element_by_xpath("your xpath")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM