I'm scraping https://en.wikipedia.org/wiki/Gadsden,_Alabama and I want to grab the "Geography and climate" paragraph and all the text() elements until the next h2 tag occurs (which is "Demographics").
I don't want to grab the table in here.
the XPath code I've tried so far is //span[@id='Geography_and_climate']/following::pwhich selects everything until the page ends.
I've tried answers' code of similar problems on StackOverflow but nothing works for me, maybe I'm not an expert to understand their code.
nextelement and check if it is alreadyh2or not. - furasitem = item.findNextSibling()untilitem.name == 'h2'but it is code inBeautifulSoup- and if you usescrapythen it is not so useful. - furas