2015-05-13 16:28 GMT-05:00 Javier Antonio Brito Sanchez
<
logi...@transportesbrisa.com.mx>:
> Hola me pueden explicar esta parte de código y cómo podria pasarlo a java?
>
>
> year = int(data['search_year'])
> month = int(data['search_month'])
> dates = self.util.get_dates(year, month)
>
> txt = browser.find_element_by_id(self.g.SAT['date_from'])
>
> arg = "document.getElementsByName('{}')[0]." \<-----Arg que tipo de variable
El "\" al final sirve para indicar que la línea continúa, es solo para
dar formato al código
> es y Por qué estos simbolos?
> "removeAttribute('disabled');".format(<--------Este format es propio de
> phyton o se crea?
help ("".format)
format(...)
S.format(*args, **kwargs) -> string
Return a formatted version of S, using substitutions from args and kwargs.
The substitutions are identified by braces ('{' and '}').
> self.g.SAT['date_from_name'])<--------------Este valor se que lo
> importan de values.py
arg = "document.getElementsByName('{}')[0].removeAttribute('disabled');".format(666)
print arg
document.getElementsByName('666')[0].removeAttribute('disabled');
print arg.__class__
<type 'str'>
> browser.execute_script(arg)
> txt.send_keys(dates[0])<------------Por qué dates[0]?
>
La variable dateS y la función get_dateS parecen estar en plural, así
que supongo que regresa un arreglo... por qué solo la primera,
imprímela a ver que más tiene.
-Farfán
>
> saludos.
>
>
> de antemano gracias por sus comentarios
>
>
>
Do not let me induce you to satisfy my curiosity, from an expectation,
that I shall gratify yours. What I may judge proper to conceal, does
not concern myself alone.