Category : xpath

I know the very basics of using following-siblings but here I have a situation where it looks a bit more complicated. I want to find the element with text Total 6.5 where the header is Total games. How can I do it with following-siblings and contains text? <div class="group"> <div class="header_1"> <div class="section_1"> <div class="expander"></div> ..

Read more

I’m a newbie with Python and I’m trying to automate the booking: For example, I would like to book today for the next week: This is the code on the website: <a href="#" class="dp-item" data-moment="October 29 2020" title="Thursday, 29 October 2020" style="width: 113px;"> <div class="day row no-margin"> <div class="day-number col-xs-12">29</div></div> <div class="day-week">Thursday</div> <div class="month">October</div> </a> ..

Read more

Code: from time import sleep chrome_options = webdriver.ChromeOptions() chrome_options.add_experimental_option("prefs", { "profile.default_content_setting_values.media_stream_mic": 1, "profile.default_content_setting_values.media_stream_camera": 1, "profile.default_content_setting_values.geolocation": 2, "profile.default_content_setting_values.notifications": 2 }) chrome_options.add_argument("–disable-infobars") driver = webdriver.Chrome(r’../Other Projects/chromedriver.exe’, options=chrome_options) febxp = driver.find_element_by_xpath def Rmunify(): # Goes to RmUnify driver.get(‘https://sts.platform.rmunify.com/Account/SignIn?ReturnUrl=%252fissue%252fwsfed%252fwww%253fwa%253dwsignin1.0%2526wtrealm%253dhttp%25253a%25252f%25252flaunchpad.platform.rmunify.com%25252frp%2526wctx%253drm%25253d0%252526id%25253dpassive%252526ru%25253d%2525252f%2526wct%253d2020-10-20T13%25253a09%25253a46Z%2526wreply%253dhttps%25253a%25252f%25252fwww.rmunify.com%25252f’) # Types email febxp("/html/body/div[2]/div/div[2]/div[1]/div/form/div[1]/div[2]/input").send_keys("") # Types password febxp("/html/body/div[2]/div/div[2]/div[1]/div/form/div[1]/div[3]/div/input").send_keys("") # Presses Sign In febxp("/html/body/div[2]/div/div[2]/div[1]/div/form/div[3]/input").click() sleep(2) # Goes to classroom main page ..

Read more

I try access to results of tags <div> that contain the @class,’event__participant–away’, the text Team = ‘Paris SG’ to a given position (ex: postion() = 5). For this I must verified if the tags contained in resultsFinal.extend(WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.XPATH,"//div[contains(@class,’sportName’)]/div[position() = 5"))) respect the conditions, walking through his children. Otherwise add +1, if so access the tag ..

Read more

Here is a snipped of a table from this website: <table align=center border=1 cellpadding=3 cellspacing=1> <TR><TD bgcolor="#b87333"><font size=+1><b> Alexandria</b></font><br>RIC VI 99b, K-AP</td><td>Constantine I, AE follis of Alexandria. AD 308-310. FL VAL CONSTANTINVS FIL AVG, laureate head right. / GENIO CA-ESARIS, Genius standing left, modius on head, naked but for chlamys over left shoulder, holding patera ..

Read more

I have got this piece of html code: <span class=”amount ng-binding ng-scope” ng-if=”object.numberOfReactions !== null”>41</span> I want to acces the 41 number by using driver.find_elements_by_xpath, my best try is driver.find_elements_by_xpath(//div[@ng.if=’object.numberOfReactions !== null’])but this gives an empty list []. Help would be greatly appreciated. Source: Python..

Read more