How to tick checkboxes with the same name?

Peter Otten __peter__ at web.de
Fri Jul 26 03:05:15 EDT 2013


malayrev at gmail.com wrote:

> вторник, 23 июля 2013 г., 11:25:00 UTC+4 пользователь Peter Otten написал:
>> malayrev at gmail.com wrote:

>> For all but the most popular projects a url works wonders. I'm assuming

>> http://grablib.org

> Well, I have read the documentation, I guess the problem lies in somewhat
> different field. As long as I understand it refers to Checkboxgroup
> classes. As checkboxes of interest belong to some common group with the
> common name "a", they do have values different from "True" or "False"
> (probably a sequence?) and I should guess somehow what are the real ones.
> How to do this?

I took a quick look into the source, and it seems that grab has no notion of 
multiple inputs with the same name. My suggested workaround 

>> set_input_by_id(_"a1", True)

doesn't work because (among other things) the id is immediately translated 
into the name. I fear you have to construct the request manually or choose 
another library -- maybe mechanize (Python 2 only)?




More information about the Python-list mailing list