I'm using selenium as a crawler on a website. I have no experience with python.
Here I create a dataframe with the data of a .csv
df = pd.DataFrame.from_csv(
'tabela_etickets_copa3.csv',
columns = header
)
I open the browser, I go to the site, I find the elements and I set my variables
driver = webdriver.Firefox()
driver.get("xxxxxxx")
bref = driver.find_element_by_name("ctl00$SPWebPartManager1$g_1eba1641_45a3_4029_be3a_175e90e68a47$input_manage_num_reservation")
lname = driver.find_element_by_name("ctl00$SPWebPartManager1$g_1eba1641_45a3_4029_be3a_175e90e68a47$input_manage_lastname")
botao = driver.find_element_by_xpath("//button[text()='Continuar']")
Finally, I looped with for
to get the items from .csv
, enter the site and press enter
for index, row in df.iterrows():
lname.send_keys(row['PAX'].rsplit("/",1)[0]
botao.send_keys(Keys.RETURN)
driver.close()
I'm having this error:
botao.send_keys(Keys.RETURN)
^
SyntaxError: invalid syntax
What I understood here is that most commands after for
do not work. Can anyone suggest me anything?