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
2
votes
1 answer

Pyquery scrape a class having space in its class name

My problem is that i have to scrape a website which has:
blah blah
And another div in the same website having which is as follows:
blah blah
to scrape a website without space i can use…
Ravinder Baid
  • 395
  • 1
  • 15
2
votes
1 answer

Installing pyquery mac

I tried installing it with pypm first, and basically have the same experience as I did with pip (for which I have copy/pasted the output below). The installation prompt says that it is installed and for both pip and pypm, pyquery turns up in the…
Arnab Datta
  • 5,356
  • 10
  • 41
  • 67
2
votes
1 answer

How to use Pyquery with scrapy?

My objective is to use pyquery with scrapy, apparently from scrapy.selector import PyQuerySelector returns ImportError: cannot import name PyQuerySelector when I crawl the spider. I followed this specific gist…
2
votes
1 answer

How to get text content of multiple tags inside a table using PyQuery?

How to select attribute's text field from given book-details table field where values are in text or in text field? …
toanant
  • 331
  • 3
  • 9
2
votes
2 answers

Python/PyQuery: Unable to find vcvarsall.bat?

I have Python 2.7 and I was trying to use PyQuery, so for a test I just typed "import PyQuery" and I got an error: Traceback (most recent call last): File "C:\Users\Jacob\Documents\dupes.py", line 1, in import pyquery File…
Marcus Johnson
  • 2,505
  • 6
  • 22
  • 27
1
vote
2 answers

Setting up pyquery for python 2.7 for windows

I am trying to setup pyquery,but is giving me a hard time. There is .py file setup.py , which imports from setuptools I also read lxml can be used instead of that ,i have installed lxml. Could anyone guide me with this installation.I also did read…
Vinod K
  • 1,885
  • 11
  • 35
  • 45
1
vote
1 answer

Why is the output repeated when I parse a string using PyQuery?

Why is the output repeated when I parse a string using PyQuery in Spyder? Here is my code: from pyquery import PyQuery as pq html = """
1
vote
1 answer

use pyquery to filter html

I'm trying to use pyquery parse html. I'm facing one uncertain issue. My code as below: from pyquery import PyQuery as pq document = pq('

Hello

World !!

') p = document('p') print(p.filter("#hello")) And the…
1
vote
0 answers

What is the PyQuery equivalent of jQuery's ._data.map()?

I've been tasked to learn to code by translating this program https://github.com/metacoglab/metacognition-task-online from javascript to Python... big undertaking and I only know R so sorry if this is a confused question. Line 30 of the design.js…
M.L.
  • 117
  • 7
1
vote
1 answer

Parse an HTML element using the pyquery library or beautifulsoup. or a different alternative

no yes I want to parse div1 and I get its text if it has one and I want to keep {name_class: tag1 (or None), text: None}, and I reiterate: {name_class:…
1
vote
2 answers

undefined symbol: xsltGetProfileInformation while importing pyquery

I'm trying to use pyquery on Python 3.8.3, and fail due to: >>> import pyquery Traceback (most recent call last): File "", line 1, in File "/opt/lib/python3.8/site-packages/pyquery/__init__.py", line 7, in from…
Nben
  • 127
  • 7
1
vote
2 answers

Pyquery invalidates html code

I was using pyquery to construct a webpage: > page = PyQuery('') > print page Output:…
shafty
  • 609
  • 7
  • 17
1
vote
1 answer

Extracting web elements using Pyquery, Requests and Gadget selector

I am able to extract table values from this website with the following code. from pyquery import PyQuery as pq import requests url = "https://finviz.com/screener.ashx" content = requests.get(url).content doc = pq(content) Tickers =…
1
vote
1 answer

Remove all hidden elements in html using pyquery in python

I have a piece of html code where I have to remove the hidden elements from it. I tried the following code from pyquery import PyQuery html_data = '''
This is a hidden div.

This is another paragraph.

newbie
  • 1,282
  • 3
  • 20
  • 43
1
vote
1 answer

Use existing cookies from Firefox session for PyQuery requests

I would like to use PyQuery for extract information from a site that requires authentication. I can access the site "manually" and then see the resulting cookie in Firefox's Tools > Web Developer > Storage Inspector. Can I somehow use this cookie…
rookie099
  • 2,201
  • 2
  • 26
  • 52
Book Details