Closed DeltaDarkness closed 10 months ago
this line break my code
Can you point out the file which you are referring to?
i mean
driver.execute_script("")
not work in this lib
@DeltaDarkness Please provide
Code :
await driver.get('https://probot.io/daily')
await driver.implicitly_wait(10)
await asyncio.sleep(3)
elem3 = await driver.find_element(By.CSS_SELECTOR, "#main > div:nth-child(3) > section > div > div > div:nth-child(1) > div:nth-child(1) > div > div > div > div.onboarding-container > div > button")
await elem3.click()
await asyncio.sleep(3)
elem4 = await driver.find_element(By.CSS_SELECTOR, "#main > div:nth-child(3) > section > div > div > div:nth-child(1) > div.daily-parent > div > div.daily-logo-text")
await elem4.click()
await asyncio.sleep(4)
sitekey = await driver.execute_script("return document.querySelector('body > input[id]').getAttribute('value');")
print(sitekey)
api_key = "YOUR_API"
solver = TwoCaptcha(api_key)
print("Solving captcha...")
response = solver.recaptcha(sitekey=sitekey,url=web,)
print(f'Captcha Key: {response["code"]}')
driver.execute_script("document.getElementById('g-recaptcha-response').value = '{}';".format(response["code"]))
//////////////////////////////
error :
TypeError: Cannot read properties of null (reading 'getAttribute')
at <anonymous>:1:75
iframe = await driver.find_element(By.CSS_SELECTOR,"iframe[name^='a-'][src^='https://www.google.com/recaptcha/api2/anchor?']")
await driver.switch_to.frame(iframe)
@DeltaDarkness JavaScript
I am pretty sure the JavaScript Error isn't a bug:) Seems to me more like the elemen't isn't loaded yet or doesn't exist
Iframe
dublicate to https://github.com/kaliiiiiiiiii/Selenium-Driverless/issues/8
yes sir i am sorry i will check before do it again thanks for u effort