1
votes

On one of the sites for which I am writing a parser, I encountered the following problem: I need to take all the data from the table, but they are not signed in the html code and are swapped html example

The table looks like this: table

At first I used XPATH for this, but when parsing, I found that some data was swapped, such as engine and registration number, or not at all. So XPATH is not suitable, because data with mileage can get into the line with the engine in the csv file

Is it possible somehow in selenium or through bs4 to first search for a word, and then parse the data after it?

That is, what would find the word Engine in the html code, and then take the data below html text that I need

Post a minimal reproductible example, which can be copy pasted by whoever wants to help you. Do not post pictures please. Post your code, show what you have tried until now. - platipus_on_fire
@platipus_on_fire , I asking if there any method, that can search specific text in html code (not by link, tag name, class and etc.) Not for ready code Code that I already have doesn't help here, it just collect all URLs and some data in those URLs I already write, that I try XPATH, but the tables swapped in different cars and it not suitable. So why I need to put any code with method, that didn't fit or the part that is not relevant to the question ? Picture's are for showing tables on sites and some details. - Tomas Adomson
Because whoever is willing to put in the time and effort to help you for free should be able to recreate your context easily. See stackoverflow.com/help/how-to-ask - platipus_on_fire