Код: Выделить всё
#Set the path to the Chrome WebDriver executable
webdriver_path = '/path/to/chromedriver'
# Create Chrome WebDriver options
chrome_options = webdriver.ChromeOptions()
chrome_options.binary_location = 'C:\Program Files\Google\Chrome\Application\chrome.exe' # Optional, specify the Chrome binary location if needed
# Specify the Chrome WebDriver executable path
chrome_options.add_argument(f'--webdriver={webdriver_path}')
# Create a Chrome WebDriver instance with the specified options
driver = webdriver.Chrome(options=chrome_options)
# Maximize the Chrome window
driver.maximize_window()
#---------------------------------------------
# Navigate to coinmarketcap.com
url = 'https://dexscreener.com/'
driver.get(url)
# Wait for the page to load (you might need to adjust the time)
#driver.implicitly_wait(10)
time.sleep(5)
#print("waited 5 seconds !")
try:
#///////////////// click on filter----------------------------------------------------
button_xpath = '/html/body/div[1]/div/main/div/div[3]/div/div[1]/div/div[4]/button[2]'
button = driver.find_element(By.XPATH, button_xpath)
button.click()
Код: Выделить всё
# Disable automation flags
#chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])
#chrome_options.add_experimental_option("useAutomationExtension", False)

Подробнее здесь: https://stackoverflow.com/questions/798 ... eener-tool
Мобильная версия