Skip to content

Commit 9bc3469

Browse files
lower time complexity
1 parent 038c025 commit 9bc3469

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

ScrapeThisSite/Frames & iFrames.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ def fetch(turtle = '', tag='h3', attrs_class='family-name'):
2525
lst = []
2626
turtle = i.text.strip()
2727

28-
turtle_image = fetch(turtle, tag='img', attrs_class='turtle-image center-block')[0]
29-
family_name = fetch(turtle, tag='h3', attrs_class='family-name')[0]
30-
description = fetch(turtle, tag='p', attrs_class='lead')[0]
28+
div = fetch(turtle, tag='div',
29+
attrs_class='col-md-6 col-md-offset-3 turtle-family-detail'
30+
)[0]
3131

32-
lst.append(turtle_image['src'].strip())
33-
lst.append(family_name.text.strip())
34-
lst.append(description.text.strip())
32+
img = div.img
33+
h3 = div.h3
34+
p = div.p
35+
36+
lst.append(img['src'].strip())
37+
lst.append(h3.text.strip())
38+
lst.append(p.text.strip())
3539
data.update({j : lst})
3640

3741
df = pd.DataFrame.from_dict(
0 Bytes
Binary file not shown.

static/BackupWebScrape.zip

6.64 KB
Binary file not shown.

0 commit comments

Comments
 (0)