mercredi 30 décembre 2015

HTMLUNIT generate all the same page, but should be dynamic

I'm learning python by doing some interesting stuff. Now I want to try some page parse by playing with Selenium. There is some site which gives promo-code if all three pictures would be the same. I have a code, and when I run

java -jar selenium-server-standalone-2.48.2.jar
python givetwo_promo.py

gives me all the same lines of result no matter how much I tried, kinda:

 -668px;  -167px;  -334px;
 0px;  -167px;  -334px;
 -334px;  -167px;  -334px;
 -668px;  -167px;  -334px;
 0px;  -167px;  -334px;
 -835px;  -167px;  -334px;
 -668px;  -167px;  -334px;
 -835px;  -167px;  -334px;
 -668px;  -167px;  -334px;
 -835px;  -167px;  -334px;

But when I run from Firefox(), and open browser firstly, there would be nice result. But If I switch windows right after driver opens Firefox() there would be all same lines too.

How to force HTMLUNIT return me different results? Or more interesting question: how to forge promos, on VPS without Xorg?




Aucun commentaire:

Enregistrer un commentaire