Click on text using xpath and selenium pythonCalling an external command in PythonWhat are metaclasses in Python?Is there a way to run Python on Android?Finding the index of an item given a list containing it in PythonWhat is the difference between Python's list methods append and extend?How can I safely create a nested directory?Does Python have a ternary conditional operator?How to get the current time in PythonHow can I make a time delay in Python?Does Python have a string 'contains' substring method?
What game uses dice with sides powers of 2?
(11 of 11: Meta) What is Pyramid Cult's All-Time Favorite?
changing number of arguments to a function in secondary evaluation
A tool to replace all words with antonyms
Can a fight scene, component-wise, be too complex and complicated?
Identification of vintage sloping window
Is it really ~648.69 km/s delta-v to "land" on the surface of the Sun?
Acceptable to cut steak before searing?
What are the uses and limitations of Persuasion, Insight, and Deception against other PCs?
MinionPro is erroneous
Can you castle with a "ghost" rook?
What does "sardine box" mean?
Why are Gatwick's runways too close together?
I accidentally overwrote a Linux binary file
Help evaluating integral (anything simple that I am missing?)
Y2K... in 2019?
Why should we care about syntactic proofs if we can show semantically that statements are true?
What are the conventions for transcribing Semitic languages into Greek?
How to avoid the "need" to learn more before conducting research?
Is Calculus necessary for computer science student?
What skills in 5e give trap knowledge (i.e. the equivalent of Dungeoneering in 4e)?
How to create all combinations from a nested list while preserving the structure using R?
Dropdowns & Chevrons for Right to Left languages
Why did the RAAF procure the F/A-18 despite being purpose-built for carriers?
Click on text using xpath and selenium python
Calling an external command in PythonWhat are metaclasses in Python?Is there a way to run Python on Android?Finding the index of an item given a list containing it in PythonWhat is the difference between Python's list methods append and extend?How can I safely create a nested directory?Does Python have a ternary conditional operator?How to get the current time in PythonHow can I make a time delay in Python?Does Python have a string 'contains' substring method?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Normally I use the xpath to click on text of webpages. But now maybe because it's a table it doesnt work. I want to click on "SNOW Microsoft 2019-03-26.csv" text that is unique in the table. My code is:
browser.find_element_by_xpath("//table[@id='grdReports']/div[3]/table/tbody/tr[1]/td[3]").click()
Error: can't find the xpath
HTML looks like:
python selenium xpath
add a comment |
Normally I use the xpath to click on text of webpages. But now maybe because it's a table it doesnt work. I want to click on "SNOW Microsoft 2019-03-26.csv" text that is unique in the table. My code is:
browser.find_element_by_xpath("//table[@id='grdReports']/div[3]/table/tbody/tr[1]/td[3]").click()
Error: can't find the xpath
HTML looks like:
python selenium xpath
add a comment |
Normally I use the xpath to click on text of webpages. But now maybe because it's a table it doesnt work. I want to click on "SNOW Microsoft 2019-03-26.csv" text that is unique in the table. My code is:
browser.find_element_by_xpath("//table[@id='grdReports']/div[3]/table/tbody/tr[1]/td[3]").click()
Error: can't find the xpath
HTML looks like:
python selenium xpath
Normally I use the xpath to click on text of webpages. But now maybe because it's a table it doesnt work. I want to click on "SNOW Microsoft 2019-03-26.csv" text that is unique in the table. My code is:
browser.find_element_by_xpath("//table[@id='grdReports']/div[3]/table/tbody/tr[1]/td[3]").click()
Error: can't find the xpath
HTML looks like:
python selenium xpath
python selenium xpath
asked Mar 27 at 8:27
GonzaloGonzalo
4329 silver badges26 bronze badges
4329 silver badges26 bronze badges
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
Element with grdReports id is a div, not table:
browser.find_element_by_xpath("//div[@id='grdReports']/div[3]/table/tbody/tr[1]/td[3]").click()
Also you can try shorter xpath:
//*[@id='grdReports']//tr[@role='row']/td[3]
Css selector:
#grdReports tr[role=row] > td:nth-child(3)
add a comment |
Try the following xpath:
//table[@role='grid']//tbody/tr/td[text()='SNOW Microsoft 2019-03-26.csv']
Note: i am not sure if there is two spaces between Microsoft and 2019
add a comment |
I would just use
browser.find_element_by_xpath("//td[contains(text(),'SNOW Microsoft 2019-03-26')]").click()
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55372674%2fclick-on-text-using-xpath-and-selenium-python%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Element with grdReports id is a div, not table:
browser.find_element_by_xpath("//div[@id='grdReports']/div[3]/table/tbody/tr[1]/td[3]").click()
Also you can try shorter xpath:
//*[@id='grdReports']//tr[@role='row']/td[3]
Css selector:
#grdReports tr[role=row] > td:nth-child(3)
add a comment |
Element with grdReports id is a div, not table:
browser.find_element_by_xpath("//div[@id='grdReports']/div[3]/table/tbody/tr[1]/td[3]").click()
Also you can try shorter xpath:
//*[@id='grdReports']//tr[@role='row']/td[3]
Css selector:
#grdReports tr[role=row] > td:nth-child(3)
add a comment |
Element with grdReports id is a div, not table:
browser.find_element_by_xpath("//div[@id='grdReports']/div[3]/table/tbody/tr[1]/td[3]").click()
Also you can try shorter xpath:
//*[@id='grdReports']//tr[@role='row']/td[3]
Css selector:
#grdReports tr[role=row] > td:nth-child(3)
Element with grdReports id is a div, not table:
browser.find_element_by_xpath("//div[@id='grdReports']/div[3]/table/tbody/tr[1]/td[3]").click()
Also you can try shorter xpath:
//*[@id='grdReports']//tr[@role='row']/td[3]
Css selector:
#grdReports tr[role=row] > td:nth-child(3)
edited Mar 27 at 8:38
answered Mar 27 at 8:32
SersSers
3,4832 gold badges3 silver badges20 bronze badges
3,4832 gold badges3 silver badges20 bronze badges
add a comment |
add a comment |
Try the following xpath:
//table[@role='grid']//tbody/tr/td[text()='SNOW Microsoft 2019-03-26.csv']
Note: i am not sure if there is two spaces between Microsoft and 2019
add a comment |
Try the following xpath:
//table[@role='grid']//tbody/tr/td[text()='SNOW Microsoft 2019-03-26.csv']
Note: i am not sure if there is two spaces between Microsoft and 2019
add a comment |
Try the following xpath:
//table[@role='grid']//tbody/tr/td[text()='SNOW Microsoft 2019-03-26.csv']
Note: i am not sure if there is two spaces between Microsoft and 2019
Try the following xpath:
//table[@role='grid']//tbody/tr/td[text()='SNOW Microsoft 2019-03-26.csv']
Note: i am not sure if there is two spaces between Microsoft and 2019
answered Mar 27 at 8:33
Infern0Infern0
1,3911 gold badge3 silver badges14 bronze badges
1,3911 gold badge3 silver badges14 bronze badges
add a comment |
add a comment |
I would just use
browser.find_element_by_xpath("//td[contains(text(),'SNOW Microsoft 2019-03-26')]").click()
add a comment |
I would just use
browser.find_element_by_xpath("//td[contains(text(),'SNOW Microsoft 2019-03-26')]").click()
add a comment |
I would just use
browser.find_element_by_xpath("//td[contains(text(),'SNOW Microsoft 2019-03-26')]").click()
I would just use
browser.find_element_by_xpath("//td[contains(text(),'SNOW Microsoft 2019-03-26')]").click()
answered Mar 27 at 8:38
C. PeckC. Peck
9584 silver badges24 bronze badges
9584 silver badges24 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55372674%2fclick-on-text-using-xpath-and-selenium-python%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown