It's a very simple piece of code. I've downloaded the web page source file to my local machine, but I'm not sure where my code is wrong. Both fields that print out are empty lists. I've also checked the xpath paths repeatedly, and they seem fine. The web page source code is a bit large, but it's manageable, with over 2000 lines.
from lxml import etree def main(): html = etree.HTML('toolify_202408.html') publish_month = html.xpath('/html/body/div/section/div[1]/h2/text()') app_name = html.xpath('/html/body/div/section/div[2]/div[1]/div/div[1]/div[1]/div/div/a/div/text()') print(publish_month, app_name) if __name__ == '__main__':
main()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)