Skip to content
Advertisement

Tag: selenium-chromedriver

Get element text with a partial string match using Selenium (Python)

I am trying to extract the text from within a <strong> tag that is deeply nested in the HTML content of this webpage: https://www.marinetraffic.com/en/ais/details/ships/imo:9854612 For example: The strong tag is the only one on the webpage that will contain the string ‘cubic meters’. My objective is to extract the entire text, i.e., “138124 cubic meters Liquid Gas”. When I try

Message: element not interactable. Xpath correct

How can I click? Obviously with the mouse I can, and a new mask appears. While with the click () the following error appears. Obviously the Xpath is correct in fact it reports the following code = this message error: selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable Answer Use WebDriverWait() and wait for element_to_be_clickable() you need to import below libraries

Problem with looping over XPaths selenium

I’m trying to collect news articles off yahoo finance using selenium. I got it to work with 1 article, but when I try looping over the different articles it doesn’t make the click. The reason I have the second ‘except’ ‘continue’ is because there are ads in between the articles which I don’t want to click. The structure of the

using Selenium to get texts inside ‘ul’ tag?

Please help me to find the solution to get the text inside ‘ul’ tag. I want to get the information which is separated with commas like: ‘Contains Enzymatically Active B-Vitamins, Dietary Supplement, Non-GMO LE Certified’ website link: https://ca.iherb.com/pr/Life-Extension-BioActive-Complete-B-Complex-60-Vegetarian-Capsules/67051 picture: enter image description here This is the HTML code: Answer This should do it: Output:

Advertisement