Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Commit

Permalink
Fixed failing tests and made 'Webpage' static content parameters retu…
Browse files Browse the repository at this point in the history
…rn a list of unique items
  • Loading branch information
pawelad committed Jan 27, 2017
1 parent fe4f19c commit ced6633
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions simple_site_crawler/webpage.py
Expand Up @@ -27,32 +27,32 @@ def __init__(self, url, content):

def get_website_links(self):
"""Helper method for getting all links from HTML source"""
return {
return list({
a.get('href')
for a in self.soup.select('a')
if a.get('href')
}
})

def get_website_images(self):
"""Helper class for getting all images from HTML source"""
return {
return list({
a.get('src')
for a in self.soup.select('img')
if a.get('src')
}
})

def get_website_css(self):
"""Helper class for getting all CSS files from HTML source"""
return {
return list({
a.get('href')
for a in self.soup.select('link[rel=stylesheet]')
if a.get('href')
}
})

def get_website_javascript(self):
"""Helper class for getting all JavaScript files from HTML source"""
return {
return list({
a.get('src')
for a in self.soup.find_all('script')
if a.get('src')
}
})

0 comments on commit ced6633

Please sign in to comment.