[Load] Fwd: : Livres informatiques gratuits

Etienne Guilluy Etienne.guilluy at gmail.com
Ven 14 Fév 18:44:27 CET 2014


D'ailleurs il faut mettre stop_page+1 dans le range


On Fri, Feb 14, 2014 at 6:37 PM, Nicolas Chauvat <nicolas at chauv.at> wrote:

>  import requests
>
> session_id = raw_input('Session id: ').strip()
> start_page = int(raw_input('Start page: ').strip())
> stop_page = int(raw_input('Stop page: ').strip())
> dl_url = 'http://www.eni-training.com/client_net/get_Resource.aspx'
> content = open('dump.html','w+')
> for i in range(start_page, stop_page):
>     content.write(requests.post(dl_url, data={'idsession':session_id,
> 'idA': i}).content)
>     print '%s/%s' % (i, stop_page)
>
> ------------------------
>
> ou encore
>
> ------------------------
>
> import sys
> import requests
>
> session_id, start_page, stop_page = sys.argv[1:4]
>
> dl_url = 'http://www.eni-training.com/client_net/get_Resource.aspx'
> content = open('dump.html','w+')
> for page in range(start_page, stop_page):
>     content.write(requests.post(dl_url, data={'idsession':session_id,
> 'idA': page}).content)
>     print '%s/%s' % (page, stop_page)
>
> --
> Nicolas
>
> _______________________________________________
> Load mailing list
> Load at lists.l0ad.org
> http://lists.l0ad.org/cgi-bin/mailman/listinfo/load
>
>
-------------- section suivante --------------
Une pièce jointe HTML a été nettoyée...
URL: <http://lists.l0ad.org/pipermail/load/attachments/20140214/072277b5/attachment-0001.html>


More information about the Load mailing list