ultrafunkamsterdam / undetected-chromedriver

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
https://github.com/UltrafunkAmsterdam/undetected-chromedriver
GNU General Public License v3.0
9.15k stars 1.1k forks source link

my code cannot go to web textnow.com #1513

Open trihai306 opened 10 months ago

trihai306 commented 10 months ago

import undetected_chromedriver as uc import time from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from webdriver_manager.chrome import ChromeDriverManager from fake_useragent import UserAgent from selenium.webdriver.common.keys import Keys

options = uc.ChromeOptions()

options.add_argument("--password-store=basic") options.add_argument("--disable-popup-blocking") options.add_argument('--disable-features=TranslateUI') options.add_argument('--disable-translate') options.add_argument("--log-level=3") options.add_argument( '--auto-open-devtools-for-tabs' ) options.add_argument("--log-level=OFF") options.add_experimental_option( "prefs", { "credentials_enable_service": False, "profile.password_manager_enabled": False, 'intl.accept_languages': 'en,en_US', }, )

driver = uc.Chrome(driver_executable_path=ChromeDriverManager().install(), options=options) driver.get("https://www.textnow.com/login") driver.reconnect() driver.execute_script('''window.open("https://www.textnow.com/login","_blank");''') time.sleep(5)

driver.switch_to.window(window_name=driver.window_handles[0]) driver.close() driver.switch_to.window(window_name=driver.window_handles[0] ) time.sleep(2) driver.get("https://www.textnow.com/login") driver.maximize_window()

Wait for the page to load

wait = WebDriverWait(driver, 40)

cookies = [

]

for cookie in cookies: driver.add_cookie(cookie)

time.sleep(2)

driver.refresh()

Wait until the element with ID 'text-input' is present

wait.until(EC.presence_of_element_located((By.ID, 'text-input')))

Find the text-area by id

text_area = driver.find_element(By.ID, 'text-input') time.sleep(2)

Send the message using JavaScript

message = "Đây là tin nhắn của tôi" driver.execute_script("arguments[0].value = arguments[1]", text_area, message)

Press enter

text_area.send_keys(Keys.RETURN) time.sleep(80) driver.quit()

trihai306 commented 10 months ago

fake ip sang my

tehneydobertz commented 10 months ago

coi có iframe ko bro

trihai306 commented 10 months ago

nó k buy pass qua cloudfarce á

tehneydobertz commented 10 months ago

nó k buy pass qua cloudfarce á

thằng uc bị detec rồi ko qua dc

trihai306 commented 10 months ago

có giảm pháp nào không bác

tehneydobertz commented 10 months ago

bác thử selenium base đi from seleniumbase import Driver import time

driver = Driver(uc=True) driver.get("url") time.sleep(6) driver.quit()