This commit is contained in:
Mathew Guest 2021-12-21 02:55:26 -07:00
parent 6ae2a8dd06
commit 7e9922168f
2 changed files with 5 additions and 4 deletions

@ -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