Questions tagged [lxml.html]

lxml.html is a dedicated python package for dealing with HTML.

lxml.html is a dedicated python package for dealing with HTML. It is based on lxml's HTML parser, but provides a special Element API for HTML elements, as well as a number of utilities for common HTML processing tasks.

159 questions
-1
votes
1 answer

Cleanup HTML using lxml and XPath in Python

I'm learning python and lxml toolkit. I need process multiple .htm files in the local directory (recursively) and remove unwanted tags include its content (divs with IDs "box","columnRight", "adbox", footer", div class="box", plus all stylesheets…
Lexx Luxx
  • 243
  • 1
  • 7
  • 13
-1
votes
1 answer

LXML/Python - Looping over a list of lxml.etree._Element

I'm trying to loop over a list of 5 lxml._Element. Here is an extract of the part of the html I'm interested in:
Grégoire de Kermel
  • 434
  • 2
  • 8
  • 22
-1
votes
2 answers

Issue with Python Selenium using `find_element_by_xpath(xpath)`

I am using Python Selenium to try and scrape or obtain data because lxml is so poorly documented with parsing HTML and obtaining data using xpath, and no matter what I try, nothing works with that library. I am having some success with Selenium like…
user10664542
  • 1,106
  • 1
  • 23
  • 43
-1
votes
1 answer

Css selector get text outside tag

I have the following HTML:
-1
votes
2 answers

Capturing name in source page using xpath in python

I have the following url source page: I want to…
MLSC
  • 5,872
  • 8
  • 55
  • 89
-1
votes
3 answers

capturing states between tags in python using xpath

I want to capture the word WORD sentence This is what I want. in following format:
WORD This is what I want.
What I tried is: import requests from lxml…
MLSC
  • 5,872
  • 8
  • 55
  • 89
-1
votes
2 answers

How do I link a local disk location URL to a tag in XML?

I am pretty new to XML and XML with Python. I am using LXML module for this. My objective is to do something like: #This is for naming the result of the file .
Ai_Nebula
  • 39
  • 9
-2
votes
3 answers

BeautifulSoup Scraping Results not showing

I am playing around with BeautifulSoup to scrape data from websites. So I decided to scrape empireonline's website for 100 greatest movies of all time. Here's the link to the webpage: https://www.empireonline.com/movies/features/best-movies-2/ I…
Daniel
  • 13
  • 4
-2
votes
1 answer

How to get data from a webpage using Python

Last year I had written a python script, to store data of COVID-19 cases (active, cured and deaths) from the website. The script was running fine initially but later due to modifications on the page I was just getting the first 2 rows which are the…
Aroosh Rana
  • 112
  • 11
1 2 3
10
11