gawel / pyquery

A jquery-like library for python
http://pyquery.rtfd.org/
Other
2.3k stars 182 forks source link

Google Chrome+Selenium+PyQuery issue #76

Closed stigdescamps closed 10 years ago

stigdescamps commented 10 years ago

Hi,

Since Chrome upgraded, I have issues in the following code:

driver.get(url_) # Selenium part

jQuery = pq(self.driver.page_source) # PyQuery part

for zone in jQuery("table"): table = jQuery(zone) if table.attr("class") == "gf-table historical_price": ... here I read the content ...

Unfortunately, it worked perfectly before Google Chrome upgraded 2 or 3 months ago, and now I read no content at all. I have content in the jQuery variable but it seems impossible to read it as html in the loop.

As a workaround, I downgraded Chrome but for some reason, Chrome automatically upgrade while I blocked it. Anyway, that is a dirty solution.

Do you see where is the reason for this problem?

Regards, SD

gawel commented 10 years ago

Are you sure that table.attr("class") == "gf-table historical_price" is true ? You can try with table.hasClass('gf-table') and table.hasClass('historical_price') Or maybe with for zone in jQuery('table.gf-table.historical_price'): Does this help ?

stigdescamps commented 10 years ago

Thanks for your reply. I tried the two, and this does not work neither.

I suspect there is a problem in the input of the pq class ("jQuery = pq(driver.page_source)") as I have not upgraded PyQuery and the html of the web page seems identical.

If it's so, then this is the selenium get() which has an issue due to a webpage coding issue or something since google Chrome v35. Yet, I have not found any information regarding this.

Do you have a mean to check that "driver.page_source" in my code is readable for the pq class?

Regards, SD

gawel commented 10 years ago

not really. can you past the html output on a pastebin ( like http://friendpaste.com ) ?

stigdescamps commented 10 years ago

here is the driver.pagesource: https://friendpaste.com/5rwzxEhGpHEhGOUOPFfkjU with url="http://www.google.com/finance/historical?q=NYSEARCA%3AIYM&startdate=Jul+31%2C+2014&enddate=Aug+01%2C+2014&num=300"

In the idle shell I have also:

jQuery [<{http://www.w3.org/1999/xhtml}html>]

whereas:

print jQuery

Githubissues.
  • Githubissues is a development platform for aggregating issues.