mirror of
https://git.zavage.net/Zavage-Software/wikicrawl.git
synced 2024-11-21 07:50:25 -07:00
fix
This commit is contained in:
parent
6ae2a8dd06
commit
7e9922168f
@ -69,7 +69,7 @@ class Model:
|
|||||||
self.ctx.log['cli'].warn('failed to process "%s" as a parameter' % n)
|
self.ctx.log['cli'].warn('failed to process "%s" as a parameter' % n)
|
||||||
return False
|
return False
|
||||||
for i in range(n):
|
for i in range(n):
|
||||||
self.model.play_random_page()
|
self.play_random_page()
|
||||||
|
|
||||||
|
|
||||||
def play_random_page(self):
|
def play_random_page(self):
|
||||||
|
@ -6,6 +6,7 @@ from . import browser
|
|||||||
from . import util
|
from . import util
|
||||||
from .assets.languages import LANGUAGES
|
from .assets.languages import LANGUAGES
|
||||||
|
|
||||||
|
import logging
|
||||||
import re
|
import re
|
||||||
import selenium
|
import selenium
|
||||||
import time
|
import time
|
||||||
@ -220,13 +221,13 @@ class ArticlePage(PageRootObject):
|
|||||||
if len(links) == 0:
|
if len(links) == 0:
|
||||||
return False
|
return False
|
||||||
for link in links:
|
for link in links:
|
||||||
self.ctx.log['pages'].debug('processing link: %s' % link.text)
|
logging.getLogger('pages').debug('processing link: %s' % link.text)
|
||||||
if not self._is_valid_link(p, link):
|
if not self._is_valid_link(p, link):
|
||||||
self.ctx.log['pages'].debug('skipping link inside parenthesis: %s' % link.text)
|
logging.getLogger('pages').debug('skipping link inside parenthesis: %s' % link.text)
|
||||||
self.highlight(link, 'blue')
|
self.highlight(link, 'blue')
|
||||||
continue
|
continue
|
||||||
self.highlight(link, 'red')
|
self.highlight(link, 'red')
|
||||||
self.ctx.log['pages'].info('selected link: %s' % link.text)
|
logging.getLogger('pages').info('selected link: %s' % link.text)
|
||||||
self.click(link)
|
self.click(link)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user