Category : element

I am trying to use the SetFromElementLabels method in an Abaqus Python script to create set of particular element. Works with PART as it should: e = p.Set(edges=p.edges[0:1], name=’edge’) elem = e.elements n=len(elem)/5 p.SetFromElementLabels(name=’my_el’, elementLabels=(n, )) But I cannot accomplish this with Assembly: e_a=a.Set(edges=i.edges[0:1], name=’a_edge’) elem_a = e_a.elements n_a=len(elem_a)/5 a.SetFromElementLabels(name=’me_ela’, elementLabels=(‘Instance-1’, n_a)) , where: p ..

Read more

I am new to Python and have a question about list. Can i append the elements in a list to add text in front and after ? Example mylist = [‘Audi’, ‘Bmw’, ‘Mercedes’] I want to add " sign to every other item so it looks like this: mylist = [‘"Audi"’, ‘"Bmw"’, ‘"Mercedes"’] Source: Python ..

Read more

i want to automate google cloud signup form but cant do this by selenium because i m unable to find the element for choosing option Required option to Choose bus= driver.find_element_by_xpath("//div[@class=’goog-inline-block goog-flat-menu-button-caption’]//div[@class = ‘goog-menuitem-content’]") print(bus) code in which it throws exception that we can’t find the element as mentioned in pictures when we find the ..

Read more

I am getting the following error when trying to parse the last page of my loop and exit the loop once the next (») button no longer exists: selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: » Code: while True: prices = driver.find_element_by_id(‘showAllGraphsButton’) prices.click() time.sleep(6) s_container = driver.find_element_by_id(‘stockContainer’) stocks = WebDriverWait(s_container, 10).until(EC.visibility_of_all_elements_located((By.CLASS_NAME, "imageRow"))) for stock in stocks: ..

Read more

I am trying to find the search bar in this link: https://www.takealot.com using the class "search-field" from: input class=”search-field ” type=”text” placeholder=”Search for products, brands…” value=”” My Code: from selenium import webdriver import time driver = webdriver.Firefox() driver.get("https://www.takealot.com/") print(driver.page_source) time.sleep(100) driver.quit() I have set sleep to 100 hoping that the HTML was taking long to ..

Read more