Questions tagged [pyquery]

pyquery is a jquery-like library for python that allows you to make jquery queries on xml documents.

PyQuery uses lxml for fast XML and HTML manipulation.

It allows you to make jQuery-style CSS-selector queries on XML/HTML documents. The API is intended to match jQuery's API whenever possible, though it has been made more Pythonic where appropriate

It can be used for many purposes. The main idea is to use it for templating with pure http templates that you modify using pyquery. I can also be used for web scrapping or for theming applications with Deliverance.

Read more

97 questions
1
vote
1 answer

pdfquery not returning values in BBOX

I am attempting to return the text within a desired bbox of a pdf using pdfquery library. import pdfquery pdf = pdfquery.PDFQuery("C:/Users/tyler.cowan/Desktop/PDF Miner/test.pdf") test = pdf.extract([ ('UWI/API',…
Tyler Cowan
  • 820
  • 4
  • 13
  • 35
1
vote
2 answers

How do I get text from tables using PyQuery?

I should start by saying I've not used pyquery much, so this question is probably easy, but I've tried a bunch of stuff and am stuck. I'm using PyQuery to get info from a table. Here is the beginning of my table:
Doubledown
  • 458
  • 1
  • 6
  • 13
1
vote
0 answers

pyquery not installing on google cloud console

I am trying to install pyquery on google cloud console. I tried the command pip install pyquery which worked fine on my local system. But when i run it on cloud console it gives the following error. pyquery installation error pyquery installation…
1
vote
3 answers

How to install a specific version of a package with pip

I want to install Pyquery 1.2.4 version, but when I try pip install pyquery==1.2.4 I face with Compile failed: command 'gcc' failed with exit status 1 creating tmp cc -I/usr/include/libxml2 -c /tmp/xmlXPathInitXZJM6c.c -o…
Yuseferi
  • 7,931
  • 11
  • 67
  • 103
1
vote
2 answers

How can I build pyquery for pypy?

I'm trying to use pyquery with pypy but it depends on lxml2, which won't build under pypy. I know there's a lxml2 build that is meant to be used with pypy but I don't know how to make pyquery use that instead of the usual one.
ruipacheco
  • 15,025
  • 19
  • 82
  • 138
1
vote
1 answer

Passing variable to :contains() selector, pyquery/cssselect, error

I'm using pyquery to scrape some data and would like to iterate over some key words combined with matching regular expressions. I try passing the keys as variables, however I keep getting the following error: ExpressionError: Expected a single…
1
vote
2 answers

How can I extract the message?

user4093955

1
vote
1 answer

PyQuery Code for a Web Scraper

I'm kinda new to python but I'm trying to make a web scraper script where it downloads all the pictures on a website. I'm using requests and PyQuery since many people recommended it after some research. This is all I have right now and I'm not sure…
Took
  • 11
  • 2
1
vote
1 answer

PyQuery Python not working with for loop

I am trying to write a program that pulls the urls from each line of a .txt file and performs a PyQuery to scrape lyrics data off of LyricsWiki, and everything seems to work fine until I actually put the PyQuery stuff in. For example, when I…
thenorm
  • 35
  • 7
1
vote
1 answer

Extracting author from the article

Just as the title says, I've been working on crawling the article, all that's left is the author. Below is my code, using pyquery to compile the paragraphs and author, with only the author returning blank site of target:…
fsbinesh
  • 21
  • 3
1
vote
2 answers

How to parse HTML table using pyquery?

How to parse HTML table using pyquery? [See Source code html table on http://pastie.org/pastes/8556919 Result: { "category_1":{…
user1667957
  • 81
  • 1
  • 1
  • 10
1
vote
1 answer

How can I get content value from meta tag using PyQuery?

How can I get content value from this meta tag using PyQuery? from pyquery import PyQuery def get_data(myurl): …
netman97
  • 111
  • 1
  • 1
  • 6
1
vote
1 answer

Not able to parse big HTML using PyQuery

As I'm not sure if the issue I'm facing is a bug or lack of knowledge from my side, I would like to ask for you assistance. The case is, when trying to parse this url (http://ies.ieee-ies.org/resources/media/publications/TIEpub/1988_2013.htm) using…
alfetopito
  • 1,453
  • 2
  • 18
  • 27
1
vote
1 answer

PyQuery: extract id from html?

I try to get all the "id" from an html file with PyQuery, but is bringing troubles...I try this: from pyquery import PyQuery file = open('index.html', 'r').read jQuery = PyQuery(html) jQuery.attr('id') But shows nothing... Help me please.
gasgen
  • 319
  • 1
  • 2
  • 14
1
vote
1 answer

How to unescape special characters while converting pyquery object to string

I am trying to fetch a remote page with python requests module, reconstruct a DOM tree, do some processing and save the result to file. When I fetch a page and then just write it to the file everything works (I can open an html file later in the…
Nik
  • 1,508
  • 1
  • 13
  • 15