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;








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:



html










share|improve this question






























    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:



    html










    share|improve this question


























      0












      0








      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:



      html










      share|improve this question














      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:



      html







      python selenium xpath






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 27 at 8:27









      GonzaloGonzalo

      4329 silver badges26 bronze badges




      4329 silver badges26 bronze badges

























          3 Answers
          3






          active

          oldest

          votes


















          0














          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)





          share|improve this answer


































            1














            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






            share|improve this answer
































              1














              I would just use



              browser.find_element_by_xpath("//td[contains(text(),'SNOW Microsoft 2019-03-26')]").click()





              share|improve this answer



























                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
                );



                );













                draft saved

                draft discarded


















                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









                0














                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)





                share|improve this answer































                  0














                  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)





                  share|improve this answer





























                    0












                    0








                    0







                    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)





                    share|improve this answer















                    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)






                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    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


























                        1














                        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






                        share|improve this answer





























                          1














                          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






                          share|improve this answer



























                            1












                            1








                            1







                            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






                            share|improve this answer













                            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







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Mar 27 at 8:33









                            Infern0Infern0

                            1,3911 gold badge3 silver badges14 bronze badges




                            1,3911 gold badge3 silver badges14 bronze badges
























                                1














                                I would just use



                                browser.find_element_by_xpath("//td[contains(text(),'SNOW Microsoft 2019-03-26')]").click()





                                share|improve this answer





























                                  1














                                  I would just use



                                  browser.find_element_by_xpath("//td[contains(text(),'SNOW Microsoft 2019-03-26')]").click()





                                  share|improve this answer



























                                    1












                                    1








                                    1







                                    I would just use



                                    browser.find_element_by_xpath("//td[contains(text(),'SNOW Microsoft 2019-03-26')]").click()





                                    share|improve this answer













                                    I would just use



                                    browser.find_element_by_xpath("//td[contains(text(),'SNOW Microsoft 2019-03-26')]").click()






                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Mar 27 at 8:38









                                    C. PeckC. Peck

                                    9584 silver badges24 bronze badges




                                    9584 silver badges24 bronze badges






























                                        draft saved

                                        draft discarded
















































                                        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.




                                        draft saved


                                        draft discarded














                                        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





















































                                        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







                                        Popular posts from this blog

                                        Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                                        Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                                        Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript