Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 21.05 54 lines 1.9 kB view raw
1--- a/woob/browser/browsers.py 2+++ b/woob/browser/browsers.py 3@@ -930,23 +930,6 @@ 4 5 :class:`NextPage` constructor can take an url or a Request object. 6 7- >>> from .pages import HTMLPage 8- >>> class Page(HTMLPage): 9- ... def iter_values(self): 10- ... for el in self.doc.xpath('//li'): 11- ... yield el.text 12- ... for next in self.doc.xpath('//a'): 13- ... raise NextPage(next.attrib['href']) 14- ... 15- >>> class Browser(PagesBrowser): 16- ... BASEURL = 'https://woob.tech' 17- ... list = URL('/tests/list-(?P<pagenum>\d+).html', Page) 18- ... 19- >>> b = Browser() 20- >>> b.list.go(pagenum=1) # doctest: +ELLIPSIS 21- <woob.browser.browsers.Page object at 0x...> 22- >>> list(b.pagination(lambda: b.page.iter_values())) 23- ['One', 'Two', 'Three', 'Four'] 24 """ 25 while True: 26 try: 27--- a/woob/browser/pages.py 28+++ b/woob/browser/pages.py 29@@ -49,25 +49,6 @@ 30 31 :class:`NextPage` constructor can take an url or a Request object. 32 33- >>> class Page(HTMLPage): 34- ... @pagination 35- ... def iter_values(self): 36- ... for el in self.doc.xpath('//li'): 37- ... yield el.text 38- ... for next in self.doc.xpath('//a'): 39- ... raise NextPage(next.attrib['href']) 40- ... 41- >>> from .browsers import PagesBrowser 42- >>> from .url import URL 43- >>> class Browser(PagesBrowser): 44- ... BASEURL = 'https://woob.tech' 45- ... list = URL('/tests/list-(?P<pagenum>\d+).html', Page) 46- ... 47- >>> b = Browser() 48- >>> b.list.go(pagenum=1) # doctest: +ELLIPSIS 49- <woob.browser.pages.Page object at 0x...> 50- >>> list(b.page.iter_values()) 51- ['One', 'Two', 'Three', 'Four'] 52 """ 53 54 @wraps(func)