Hacker News new | past | comments | ask | show | jobs | submit login
Pyquery 0.2 : jQuery for Python (python.org)
38 points by iamelgringo on Dec 5, 2008 | hide | past | favorite | 8 comments



Sounds a lot like ruby's hpricot.

Wish I saw this earler - I am already in the middle of a project (screen scraping of course) using hpricot.

Sounds weird, but the only reaason to pick ruby for me was hpricot and not RoR :)


Yes its like Ruby's Hpricot and also Perl's pQuery. This jQuery way of accessing XML/HTML is certainly catchy!


The whole point of jQuery is to serve as a substitute for the DOM, allowing scripts to efficiently interact with page elements. If you're running this via a Python script, you already control each and every bit of your page code. What's the point? I can only see this being useful in Python for screen scraping.


Scraping with BeautifulSoup works pretty well, but i've had a lot of problems with nested elements with no id since Xpath is not available on BeautifulSoup. Perhaps this would make it a little easier. I'll report back after trying it.


For the time being it doesn't use the BeautifulSoup parser so it may not work on very bad html, but I'll add an option an option to use it.


It could be used to skin an application ala deliverance. Or as a templating language: you would only write html and then put stuff into it with python and pyquery (but I think the jquery API may not be good enough for that).


I like this, but have no clue how I would use it beside for some BeautifulSoup page manipulation....


For parsing XML responses? lxml is better than BeautifulSoup in terms of performance and memory usage.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: