mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2025-02-16 21:38:33 +00:00
show dots as progress bar for titles fetching
This commit is contained in:
parent
ee93807a0a
commit
1ca27a60b2
1 changed files with 1 additions and 0 deletions
|
@ -234,6 +234,7 @@ def fetch_page_title(url, default=True):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sys.stdout.write('.')
|
sys.stdout.write('.')
|
||||||
|
sys.stdout.flush()
|
||||||
html_content = urllib.request.urlopen(url, timeout=10).read().decode('utf-8')
|
html_content = urllib.request.urlopen(url, timeout=10).read().decode('utf-8')
|
||||||
match = re.search('<title>(.*?)</title>', html_content)
|
match = re.search('<title>(.*?)</title>', html_content)
|
||||||
return match.group(1) if match else default or None
|
return match.group(1) if match else default or None
|
||||||
|
|
Loading…
Add table
Reference in a new issue