I want to click on elements whose class is “innerImageWrapper editlink”. I use this code but it’s not working. it’s working. but I dont want use xpath. I want use class name Answer By.CLASS_NAME receives single value while here you trying to pass 2 values: innerImageWrapper and editlink. To locate element by 2 class names you can use CSS Selector
Tag: css-selectors
Python Selenium: Inputting Email Address and Password and click Continue
I am using the following code to input Email address and password, by clicking the continue element. However I have no idea should I enter driver.switch_to_frame and then webdriver can enter the email and password and click? Answer It’s unclear what is the problem you faced with, why your code didn’t work. Maybe you missind delay to wait for elments
How to solve “selenium.common.exceptions.NoSuchElementExceptio” in selenium when creating a twitter bot?
I am trying to creating a twitter bot and I am stuck on the log in page. Here is my code: I am always getting the the below mentioned error: I have tried it with css_selector, xpath, class, ID but nothing seems to work. I am not able to click the box to enter my email ID and password. Can
How to get the a href link from under the div class? using beautiful soup
I am trying to scrape the href attribute from links from a page, but I end up with [] as the output The HTML code is My desired output is: https://www.pigiame.co.ke/listings/nissan-latio-2016-36000-kms-5300124 Answer You can try: Prints:
How to find the attribute and element id by selenium.webdriver?
I am learning web scrapping since I need it for my work. I wrote the following code: However, it is showing the following error: Then I inspect the table that I wanna scrape this table from this page what is the attribute that needs to be included in get_attribute() function in the following line? what I should write in the
Performing web scraping using selenium on influenster.com. I am getting just one scraped review even though it was in loop and the xpath was correct
OUTPUT IS JUST ONE NAME AND NOT ALL I need to scrape all the reviews from https://www.influenster.com/reviews/loreal-paris-elvive-extraordinary-oil-deep-nourishing-shampoo-and-conditioner-set-126-fl-oz. Even I am running a loop I am getting only one username. Please help me out Answer You getting only 1 review because XPath locator you are using //*[@id=”app-base”]/div[1]/div[4]/div[1]/div[1]/div[3] returns only 1 element, so your for loop is performed only once. You can
How to interact with the button using Selenium webdriver and Python
I want to try filling out the form on this page: https://konzinfoidopont.mfa.gov.hu. However, when I try to select the dropdown menu and click it, I get the following error: This is the mentioned button: And my code yet: Answer The desired element is within a Modal Dialog Box, so to click on the clickable element you need to induce WebDriverWait
Getting text from a object with Selenium
I’m trying to get the text inside of <pre> tag and I have tried with get_attribute(‘text’), get_attribute(‘value’), .text(), .value(), get_attribute(“innerHTML”) but I keep failing: Snapshot: This is the code that i’m using: And this is what it says when print: Answer To print the text within the <pre> tag you can use either of the following locator strategies: Using css_selector
How to extract the values of the alt atributte within img with selenium python
I have the following problem, I haven’t been able to solve it. I have to extract the text that appears in an alt attribute of an image. The id always changes, as does the contained alt. I noticed that the id only changes in this part Anyway, I am still unable to log in. Answer To extract and print the
Selenium : Get text inside an element but not texts inside the nested tags within it
Lets say I have an element When I am fetching the element by classname This gives me What I wanted was just ₹199. Note that I can’t just format the text and get the first text on split by space as the structure of the page keeps changing. Answer Using little bit JS: Output: What we are doing with JS