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

                                        SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                                        은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현