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

Submit a javascript form with PyQuery in Python

I'm trying to use a combination of Python, PyQuery and Paste to submit a javacript from in a web page. I know a bit of Python, but I'm really new to javascript. What I tried was the following: from pyquery import PyQuery as pq import urllib d =…
jbssm
  • 6,861
  • 13
  • 54
  • 81
0
votes
0 answers

Python report bbox pyquery within PDF when multiple LTTextLineHorizontal

I have a PDF file on which I want to report a specific "Contact Name:" text bbox set of coordinates. I am using pyquery with a kind of statement: pdf.pq('LTTextLineHorizontal:contains("Contact Name:")') Then, I select the coordinates…
0
votes
1 answer

How to extract the table values and load into pandas data frame?

I have this code. I am trying to extract data from this website into pandas. from pyquery import PyQuery as pq import requests import pandas as pd url = "https://www.tsa.gov/travel/passenger-volumes" content = requests.get(url).content doc =…
prashanth manohar
  • 531
  • 1
  • 13
  • 30
0
votes
0 answers

How to take a second command from a previous command with a python virtual assistant

I have a python virtuall assistant named Anna. She can listen for commands, but what I want is to have a secondary command after you ask her the first command. For example, tell her you want to go to stack overflow. Then she can ask you if you want…
0
votes
1 answer

PyQuery find() in pandas

I have a pandas dataframe with multiple columns. I am working on a specific column named "Text_annotated" whose structure is like : Text_annotated Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do…
Marrluxia
  • 61
  • 1
  • 9
0
votes
1 answer

PyQuery for Python3

So according to this here PyQuery is "Python3 compatible", but I can't find any information about how to actually install it, since it still seems to be dependent on setuptools which is python2.x only. I also tried to newest source from bitbucket…
Voo
  • 29,040
  • 11
  • 82
  • 156
0
votes
1 answer

PyQuery and PDFQuery text extraction from next sibling in XML or PDF

I'm trying to extract information from a PDF using the package PDFQuery. The information is not in the same location every time so I need to have a query tag. First, I wrote the function: def clean_text_data(text): return text.split(':')[1] I…
Alex
  • 73
  • 6
0
votes
1 answer

PyQuery won't return elements on a page

I've set up a Python script to open this web page with PyQuery. import requests from pyquery import PyQuery url = "http://www.floridaleagueofcities.com/widgets/cityofficials?CityID=101" page = requests.get(url) pqPage = PyQuery(page.content) But…
Username
  • 3,463
  • 11
  • 68
  • 111
0
votes
1 answer

how get groups last column element

How use css selector find the last element in same elements each line on python? I'm using package pyquery. I has tried tr td:nth-child(2) .score.fill:last-child, tr td:nth-child(2) .score.fill:nth-last-child(1). all failed. …
zzzz zzzz
  • 307
  • 2
  • 13
0
votes
1 answer

PyQuery html how to choose ( second tag ,nth-child)

a='''

''' from pyquery import PyQuery html = PyQuery(a) 1.Questions I try to get…
kovac
  • 307
  • 4
  • 11
0
votes
2 answers

Getting elements that have specific attributes by pyquery

I have something like this in HTML page:
  • Value1
  • Value2
Chalist
  • 3,160
  • 5
  • 39
  • 68
0
votes
1 answer

How to extract values from an infinite scroll webpage with python?

I am unable to extract any data from this website. This code works for other sites. Also, this website is extendable if a registered user scrolls down. How can I extract data from the table from such a website? from pyquery import PyQuery as…
prashanth manohar
  • 531
  • 1
  • 13
  • 30
0
votes
1 answer

Pyquery get element count

In the python library pyquery, the query result is a object, not a dictionary or an array. So how to get the query result count of result in this example? dom = '

Whoah!

nipunasudha
  • 2,427
  • 2
  • 21
  • 46
0
votes
1 answer

global variable error using Manager in multiprocessing

Here is my code, the key point is to share the tweetsvariable in multiprocessing: import urllib,urllib2,json,re,datetime,sys,cookielib from .. import models from pyquery import PyQuery from multiprocessing import Process, Pool, Queue, Manager import…
exteral
  • 991
  • 2
  • 12
  • 33
0
votes
0 answers

I cant seem to figure out whats wrong with this piece of code

from pynput.keyboard import Key, Listener import logging log_dir = "C:/Users/Name/Desktop/logs/" logging.basicConfig(filename=(log_dir + "key_log.txt"), level=logging.DEBUG, format='%(asctime)s: %(messages)s') def on_press(key): …
Newbie
  • 1