Xpath Parsing The Whole Page When I Specify Not To February 22, 2023 Post a Comment I'm parsing websites using python and XPath. What I'm trying to do is to extract the href from the So here's how is the XML (page): Solution 1: An XPath starting with a / character means that it will be begin at the document root node. To create a relative XPath from the context node, you need to put a . before the /. So your code should be: posts = page.xpath("//div[@id='posts']/div[@align='center']") for post in posts: print post.xpath(".//table/tr[1]/td[2]/a/@href") Copy Baca JugaConvert Lxml To Scrapy Xxs SelectorHow To Parse An Xml Feed Using Python?How To Click On Gwt Enabled Elements Using Selenium And Python Share You may like these posts Create A List Of Empty DictionariesExtracting A Table From A WebsiteMultiple Sessions And Graphs In Tensorflow (in The Same Process)How To Get Span's Text Without Inner Attribute's Text With Selenium? Post a Comment for "Xpath Parsing The Whole Page When I Specify Not To"
Post a Comment for "Xpath Parsing The Whole Page When I Specify Not To"