Hi Community! This is my first question, I hope that I do not violate any rules. Any help is highly appreciated - thank you all in advance!
My problem can be described as follows: I am trying to scrape content between two consecutive headers. Finding the first header is fairly easy, as I know the exact name of it. However, I have no information on the second, consecutive header besides that it must have the same style CSS properties.
My approach is to find the next element having the same CSS properties, for example the same "font-size", etc. Yet, it does not run properly.
This is a simplified, brief example of what I'm trying to achieve. Unfortunately, my code will always provide me empty results:
##Get the attribute of the first element (header), which I found already## attr1 = str(element.value_of_css_property("font-size")) ##Get list of items with the same css-property so that I can find the "consecutive element" elements = driver.find_elements_by_css_selector("*[font-size='"+attr1 +"']")
As I am new to programming, please forgive me beginner-misstakes.