ATuringtest 14 Posted January 31, 2020 Report Share Posted January 31, 2020 I'm trying to write an xpath to click on this button highlighted , it seems to be the most unique thing I just need a few examples then I should be able to work it out myself from then on <button id="button" class="style-scope yt-icon-button" aria-label="More actions"> <yt-icon class="style-scope ytd-menu-renderer"><svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" class="style-scope yt-icon" style="pointer-events: none; display: block; width: 100%; height: 100%;"><g class="style-scope yt-icon"> <circle cx="5" cy="12" r="2" class="style-scope yt-icon"></circle><circle cx="12" cy="12" r="2" class="style-scope yt-icon"></circle><circle cx="19" cy="12" r="2" class="style-scope yt-icon"></circle> </g></svg> </yt-icon> </button> Quote Link to post Share on other sites
SourceUltra 10 Posted January 31, 2020 Report Share Posted January 31, 2020 This should help https://www.inviul.com/svg-elements-xpath-selenium/ Quote Link to post Share on other sites
Bot-Factory 602 Posted January 31, 2020 Report Share Posted January 31, 2020 The best way and fastest way is to get "xpath builder pro" software from Dan.. It is free now.. Actually it's not free. You get it with your ExBrowser license :-) RegardsDan 1 Quote Link to post Share on other sites
ATuringtest 14 Posted January 31, 2020 Author Report Share Posted January 31, 2020 Actually it's not free. You get it with your ExBrowser license :-) RegardsDan And it works fantastic - if you know what your doing lol . I spent a good part of a hour working through it - checking stack overflow so incase anyone wants to do a similar thing heres how I figured it out Example form SO "//button[contains(@class,\"CalendarDay__button\") and contains(@aria-label,\"Choose monday, february 5 2018 as your check-in date. It's available.\")]" I then narrowed it down to the nearest : as in = //*[@id=nearest]//button[contains(@attribute1, \"content1\") and contains(@attribute2, \"content2\")] So by starting with a semi-difficult problem I now have the skills to romp through the more simple ones. 1 Quote Link to post Share on other sites
SourceUltra 10 Posted February 1, 2020 Report Share Posted February 1, 2020 well good job then, champ! 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.