lxml Questions

4

Solved

I have a huge xml file (1 Gig). I want to move some of the elements (entrys) to another file with the same header and specifications. Let's say the original file contains this entry with tag <t...
Bogey asked 9/8, 2011 at 23:20

2

I am trying to parse a file such as: http://www.sec.gov/Archives/edgar/data/1409896/000118143112051484/0001181431-12-051484.hdr.sgml I am using Python 3 and have been unable to find a solution wit...
Norenenorfleet asked 20/9, 2012 at 2:39

2

Solved

I occasionally use res.content or res.text to parse a response from Requests. In the use cases I have had, it didn't seem to matter which option I used. What is the main difference in parsing HTML...
Adigranth asked 20/10, 2016 at 19:52

2

Solved

I want to parse HTML with lxml using XPath expressions. My problem is matching for the contents of a tag: For example given the <a href="http://something">Example</a> element...
Stutsman asked 14/4, 2010 at 13:35

5

i have installed an lxml on my mac, when i type in python like this localhost:lxml-3.0.1 apple$ python Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) [GCC 4.2.1 (Apple Inc. build 5666)...
Collegiate asked 13/11, 2012 at 5:28

2

Solved

I am using selenium and I need to find the XPaths of some selenium web elements. For example: import selenium.webdriver driver = selenium.webdriver.Firefox() element = driver.find_element_by_xpa...
Brillatsavarin asked 25/6, 2014 at 14:43

6

I am attempting to use pip to install lxml. I have Windows 11 and Python version python-3.10.2-amd64. I am using Visual Studio Code (VSC) as well. I realized I needed lxml from this error message i...
Ascribe asked 17/2, 2022 at 4:57

2

Solved

Is there a difference between the capabiities of lxml and html5lib parsers in the context of beautifulsoup? I am trying to learn to use BS4 and using the following code construct -- ret = requests...
Saraband asked 3/9, 2013 at 0:44

22

... soup = BeautifulSoup(html, "lxml") File "/Library/Python/2.7/site-packages/bs4/__init__.py", line 152, in __init__ % ",".join(features)) bs4.FeatureNotFound: Could...
Sutra asked 25/6, 2014 at 0:12

25

Solved

I want to install Lxml so I can then install Scrapy. When I updated my Mac today it wouldn't let me reinstall lxml, I get the following error: In file included from src/lxml/lxml.etree.c:314: /priv...
Smelt asked 23/10, 2013 at 17:7

11

Solved

I am using lxml.html to generate some HTML. I want to pretty print (with indentation) my final result into an html file. How do I do that? This is what I have tried and got till now import lxml.htm...
Swane asked 27/5, 2011 at 9:9

5

Solved

I have installed python 3 using homebrew and afterwards installed pip3 and lxml. The following line from lxml import entree leads to the following error: $ python3 Python 3.3.5 (v3....
Detector asked 10/5, 2014 at 20:56

6

I am getting error while running "from lxml import tree" on python3.6 >>> import lxml >>> from lxml import etree Traceback (most recent call last): File "<stdin>", line 1, ...
Inseparable asked 21/11, 2018 at 6:50

12

Solved

I'm having difficulty installing lxml with easy_install on Ubuntu 11. When I type $ easy_install lxml I get: Searching for lxml Reading http://pypi.python.org/simple/lxml/ Reading http://codespea...
Eldwun asked 28/6, 2011 at 10:8

6

Solved

So, I'm having the classic trouble install lxml. Initially I was just pip installing, but when I tried to free up memory using Element.clear() I was getting the following error: Python(58695,0x1001...
Lydia asked 4/4, 2022 at 12:32

3

Solved

I've converted my scripts from Python 2.7 to 3.2, and I have a bug. # -*- coding: utf-8 -*- import time from datetime import date from lxml import etree from collections import OrderedDict # Creat...
Allix asked 1/4, 2011 at 11:37

4

Solved

I have an XML document which I'm pretty-printing using lxml.etree.tostring print etree.tostring(doc, pretty_print=True) The default level of indentation is 2 spaces, and I'd like to change this ...
Arcuation asked 6/8, 2009 at 13:47

2

Solved

I have an xml-file with a format similar to docx, i.e.: <w:r> <w:rPr> <w:sz w:val="36"/> <w:szCs w:val="36"/> </w:rPr> <w:t>BIG_TEXT<...
Valdavaldas asked 10/9, 2012 at 14:40

2

Solved

Is there a way to get the original location of an element in a document, ie. the start and end character index, when parsing html/xml in Python? I've looked through the lxml documentation and coul...
Entwistle asked 24/11, 2011 at 14:21

6

I want to use Python to obtain all the links in a domain given the 'root' URL (in a list). Suppose given a URL http://www.example.com this should return all the links on this page of the same domai...
Honeyman asked 6/1, 2016 at 10:59

2

I am trying to start a project using the Scrapy library, for a small webscraping project, but it fails on the import etree module. The exact error on the traceback is: from .. import etree ImportEr...
Melee asked 26/1, 2022 at 11:17

5

Trying to install lxml on Python 311. Faced with this error. PS C:\Users\chharlie\Desktop\code> pip install lxml Collecting lxml Using cached lxml-4.9.1.tar.gz (3.4 MB) Preparing metadata (set...
Reld asked 6/11, 2022 at 1:38

8

Solved

I am on a windows 10 machine and recently moved from python 2.7 to 3.5. When trying to install lxml through pip, it stops and throws this error message- building 'lxml.etree' extension error: ...
Syrinx asked 15/8, 2016 at 4:59

2

Solved

I've uploaded some addresses to BatchGeo and downloaded the resulting KML file from which I want to extract the coordinates. I managed to prettify the jumbled text file online here, but I don't kno...
Tomahawk asked 4/12, 2012 at 21:19

1

I have a SOAP client in Python receiving a response, which, in one element of the SOAP envelope's body receives a large stream of data (gzipped file, several GBs, machine's main memory not necessar...
Besant asked 22/7, 2016 at 13:46

© 2022 - 2025 — McMap. All rights reserved.