How to find article on website by h1 and p text like on image below?
I tried this, where I can found all articles and I don't know how to find this one with text in h1 and by text in p. And then I would like to click on this.
text = driver.find_elements_by_xpath("//article/div[contains(@class,'inner-article')]/h1")
text = driver.find_elements_by_xpath("//article/div[contains(@class,'inner-article')][h1/a[contains(text(),"Beanie")]][p/a[contains(text(),"Red")]]")
you can use above xpath, which will check whehter the parent element article/div has child elements h1/a and p/a with texts Beanie and Red respectively
in w3chool html editor is inside iframe so switch to iframe in your seelnium tests before tryng to find the element