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

Pyquery get value of "srcset" attribute

I'm trying to extract srcset attribute of a img tag using pyquery & python3. my-image Extracting alt attribute works like expected, and returns "my-image" (".item-thumb img").attr('alt') But this…
nipunasudha
  • 2,427
  • 2
  • 21
  • 46
-1
votes
1 answer

pyquery response.body retrieve div elements

I am trying to write a web crawler using scrapy and PyQuery.The full spider code is as follows. from scrapy import Spider from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor class gotspider(CrawlSpider): …
Raghu
  • 313
  • 2
  • 7
  • 19
-1
votes
1 answer

how to read jquery data with python?

I have a big jQuery data with the following format. jQuery({locations: [,…], markersContent: [,…], sidebarContent: [,…]}); Is there a way to get the context of first part (locations) with python? I tried unsuccessfully different commands in…
nakisa
  • 43
  • 1
  • 10
-1
votes
1 answer

How to trigger an event using pyquery python

I'm trying to automate a headless web browser using python and packages like pyquery, beautiful soup, requests, mechanize. But so far I haven't found a right way to trigger a click event on a button. For example, to fill an online form, I'm able to…
-1
votes
1 answer

pyquery returns [None] when opening file

If I open an html file base_result.htm with pyquery, it returns [None], and throws errors when I search it. If I use that same file as a string, everything works well. >>> d = PyQuery(filename = 'base_result.html') >>> d [None] >>> f =…
maged
  • 859
  • 10
  • 24
-3
votes
1 answer

meaning of " for a in html('.l')" in python

I have been looking in the source code of howdoi. https://github.com/gleitz/howdoi In here the extract_links_from_bing and extract_links_from_google had these kind of syntax. I tried to search online everything related to xml, element trees but…
RS156
  • 5
  • 2
-5
votes
1 answer

Get published date of news articles using Python web crawler

I need to extract different fields surrounding a news articles and I have been able to automate most of them except the published date of the news articles. Currently, I manually go to the respective website, check the HTML tag surrounding the…
ankits
  • 305
  • 1
  • 3
  • 13
1 2 3 4 5 6
7