I've just started using Selenium and I can successfully fill a form and click the submit button using the examples code, however I get an error message (which only appears written in the website after submitting, not an actual coding error) which says "There has been an error, try again".
It seems to me the website somehow knows I'm not filling the form manually, and it doesn't like that.
Is that the case ? What can I do in such cases ?
EDIT: This is the website with the form I'm trying to submit:
https://www.alitalia.com/it_it/special-pages/richiesta-rimborso-volo-cancellato.html
Related
This is what the alert looks like. It reads: The proxy it3.prmsrvs.com is requesting a username and password I have a program in Selenium that automates a certain amount of stuff on a website.
For some reason (this has been encountered also by my colleagues when using the browser normally without automation) there is the possibility of a pop-up showing in the webpage at a random point.
My program's objective is to load a page, get a list of all the elements corresponding to a specific tag and then click on them one by one. They all open in a new tab.
There is the possibility of a pop-up to show in the page after closing one of the tabs.
This pop-up asks for a login but all I have to do is dismiss it and the page will keep working like always.
Now, I've seen people using driver.switch_to.alert.dismiss() but this doesn't seem to work on this page.
I checked the function on a very basic js alert and the dismiss works perfectly, so I think it's the type of alert that is the issue.
I can't inspect the page so I don't know how to retrieve the iFrame of this alert. (I saw this as a possible solution online)
What should I do?
I have a problem with bypass Arkoselabs Funcaptcha with selenium on Twitter page.
I cant submit token because there is not any submit button.
When I try to paste token and just click random pictures I get wrong answer error.
I also tried to solve captchas by getting captcha picture and instructions, request something like 2captcha and click on images. It worked before, but now there is new type of captcha with arrows. When I did the same things I just get wrong answer from 2captcha.
Do you know what should I do?
c# code. Similar to this in Python
var captchaToken = "3084f4a302b176cd7.96368058|r=ap-southeast-1|guitextcolor=%23FDD531|......";
((IJavaScriptExecutor)chrome).ExecuteScript("parent.postMessage(JSON.stringify({eventId:'challenge-complete',payload:{sessionToken:'" + captchaToken + "'}}),'*')");
I am writing my script to automate the form filling process for multiple websites.
So I basically targeted all fields using the xpath input type = xxx
But the strange thing is that the half-done script was perfect when running. it didnt show any errors. After a few days, I decided to run the script again to continue my work but the script shows an error now.
textfields = web.find_elements_by_xpath('//input[#type="text"]')
for textfield in textfields:
if textfield.get_attribute('value')!=Name:
textfield.click()
textfield.send_keys(Name)
The variable Name contains a string message of my name. So when the script is run, the error comes from the textfield.click() saying element not interactable. The strange thing is, when I use a VPN from VPNBook, this error does not show up. But the only issue when using the VPN is that I cannot submit the form as it detects me as spam as my IP is from other country.
I would like to know what is causing this error. Am i doing something wrong?
Note: I am using Kali Linux and Python.
I'm having a problem when trying to login to target.com with selenium. I have used firefox and chromium webdriver. It's always success with the browser that opened manually. But with selenium, it always failed.
The error happens when I submit the login form. It says "error T83072242".
I have attached the AJAX response that I get here.
After doing some analysis, I got a conclusion that these variable on request header is the one that caused the error. When I replace this variable with the one from the another browser(that I open manually), the ajax request is success.
So, how to make the selenium-browser behave like the normal browser?
Pardon for my english.
I am trying to login into a website using Selenium. The website is http://projecteuler.net/login.
from selenium import webdriver
browser = webdriver.Chrome()
browser.get('http://projecteuler.net/login')
username = browser.find_element_by_id('username')
username.send_keys(USERNAME_HERE)
password = browser.find_element_by_name('password')
password.send_keys(PASSWORD_HERE)
browser.find_element_by_name("login").submit()
The program is working correctly upto the last statement. I tried omitting the last statement and manually logged in and it worked. But when I added the last statement and ran the program it just seemed to reload the same page minus the information that I had placed via the program.
So it is only the submission that is giving problem. I viewed the source and confirmed whether there is some other element by that name but there was no other element by name "login". So what am I getting wrong here? Do I need to take care of something else also?
There is a weird thing happening. When I have done form submission via code and try to view the source in Google Chrome 33.0.1750.154 m I am getting the below.
Try click() instead of submit()
Submit is particularly useful for forms without submit buttons, e.g. single-input “Search” forms.
Source:-
http://selenium.googlecode.com/git/docs/api/py/selenium/selenium.selenium.html?highlight=submit#selenium.selenium.selenium.submit
In your case there is a submit button, better to just click it.