diff --git a/code/example.py b/code/example.py index 5e0c032..35a3f2e 100644 --- a/code/example.py +++ b/code/example.py @@ -23,10 +23,7 @@ def __init__(self): soup = BeautifulSoup(html_source, 'html.parser') links = soup.findAll("a") - data = [] - for count, elem in enumerate(links): - data.append(elem) - + data = [elem for count, elem in enumerate(links)] print(browser.title) print(str(len(data)) + 'Links found') diff --git a/code/test.py b/code/test.py index 48f5b21..e5b7560 100644 --- a/code/test.py +++ b/code/test.py @@ -24,10 +24,7 @@ soup = BeautifulSoup(html_source, 'html.parser') links = soup.findAll("a") -data = [] -for count, elem in enumerate(links): - data.append(elem) - +data = [elem for count, elem in enumerate(links)] print(browser.title) print(str(len(data)) + 'Links found')