Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
Here are the relevant lines of my code:
from selenium.webdriver.support.ui import Select
select = Select(browser.find_element_by_name("TimecardPeriodList")
select.select_by_index(5)
I'm receiving an Invalid Syntax error message on the last line, with the arrow pointing at the "t" in the first "select". (this is my first post so I can't attach images yet).
Based on the threads I've seen for using select in selenium, I'm doing this correctly.
The code is missing a closing parenthesis.
select = Select(browser.find_element_by_name("TimecardPeriodList"))
^
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 12 months ago.
Improve this question
Just starting out learning Python and programming in general. Following along with a video on LIL and everything has worked fine up until now. I'm trying to access the first 3 rows of a specified series with the following code. I keep getting a syntax error where it highlights my colon. What am I doing wrong? It looks exactly like the text in the video.
import pandas as pd
import xlsxwriter
from openpyxl.workbook import Workbook
df = pd.read_excel("C:/Users/Aaron/Desktop/filename.xlsx")
print(df['Visit '],[1:3])
print(df['Visit '],[1:3])
The placement of the comma means you are passing two separate items to print():
df['Visit ']
[1:3]
The problem is the second item. [1:3] is not valid by itself.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
So here is the thing, I have a variable with the list data
[('https://jira.corp.***.com/browse/DE-3872',), ('https://jira.corp.***.com/browse/DE-3839',)].
I'm basically using split() to get the last ID ( DE-3872.. etc)
If I do this ,
for link in data:
issue = data[0][0].split('/')[4]
print(issue)
This is the output I'm getting
DE-3872
DE-3872
It prints the first value twice, but what I'm trying to get is ,
DE-3872
DE-3839
You are printing the same thing twice, use:
for link in data:
issue = link[0].split('/')[-1]
print(issue)
The [-1] index will return the last part of the result.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I have this syntax error for exactly 1 line of code. The other don't seem to be having the problem. I am inputting from an excell file to the elements. therefore, the first cell seems to be working. The syntax error occurs at the 3rd time when searching for the element.
Tried multiple other ways to change the finding the element type. instead of driver.find_element_by_id("###") i tried driver.find element(BY.ID("####")
My Code:
driver.find_element_by_id("name").send_keys(sheet[("A"+ str(2))].value)
driver.find_element_by_id("day").send_keys(sheet[("B"+ str(2))].value)
driver.find_element_by_id("month").send_keys(sheet[("C"+ str(2))].value)
driver.find_element_by_id("year").send_keys(str("1997")
driver.find_element_by_id("hrs").send_keys(sheet[("E"+ str(2))].value)*
Output:
driver.find_element_by_id("hrs").send_keys(sheet[("E"+ str(2))].value)
^
SyntaxError: invalid syntax
Process finished with exit code 1
driver.find_element_by_id("year").send_keys(str("1997")
This line is missing a closing parentheses.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I've just started Python,
and everything I was doing was working well until I encountered syntax errors when there were apparently no problems :
def things():
answer = int(input()
if answer == 1:
print("wowie my friend")
and I get invalid syntax on the ":" after the if, I don't know why.
Thanks for helping me
Beware of the parenthesis ! Each open one must be closed. It's a common mistake, but always make sure to check you didn't forgot or put an extra one if you have an InvalidSyntaxError.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I have problem with this if.
I found I can use in in if-statement.
if "log" in sys.argv[1:]
Syntax Error
If you don't show us the code surrounding the if-statement, we cannot know for sure what the problem is. If I were to make a guess however, I'd say you're missing a colon:
if "log" in sys.argv[1:]:
See the documentation for compound statements (like ifs):
Each clause header begins with a uniquely identifying keyword and ends with a colon