Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems getting text from SPAN #13

Closed
GoogleCodeExporter opened this issue Apr 21, 2016 · 2 comments
Closed

problems getting text from SPAN #13

GoogleCodeExporter opened this issue Apr 21, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

The following code echos nothing.  It should echo some prices.

$html = file_get_dom('http://www.libertysilver.se/kopa/guldtackor');
foreach($html->select('div.productBox') as $product){
   echo $product->select('span.productUnitSellPrice span', 0)->getPlainText() . "<br>";
}

It seems like whenever I have a problem with ganon, it's related to SPAN tags.

I'm using the latest version of ganon.

Thanks for you help :)

Original issue reported on code.google.com by hobblek...@gmail.com on 17 Jun 2012 at 3:40

@GoogleCodeExporter
Copy link
Author

This looks like expected behaviour. If you look at the source of the website, 
you'll see that the website seems to obfuscate its prices using JavaScript. 
This works:

echo '<script 
src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" 
type="text/javascript"></script>';

$html = file_get_dom('http://www.libertysilver.se/kopa/guldtackor');
foreach($html->select('div.productBox') as $product){
   echo $product->select('span.productUnitSellPrice', 0)->html() . "<br>\n";
}

Original comment by niels....@gmail.com on 18 Jun 2012 at 1:44

  • Changed state: Invalid

@GoogleCodeExporter
Copy link
Author

Thank you very much!

Original comment by hobblek...@gmail.com on 20 Jun 2012 at 7:06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant