Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .info.txt.swp
Binary file not shown.
1 change: 1 addition & 0 deletions info.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This will be my spider army to find all the lyrics to songs. Bad and good words alike!
22 changes: 22 additions & 0 deletions quotesbot/spiders/toscrape-css-0.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
import scrapy


class ToScrapeCSSSpider(scrapy.Spider):
name = "toscrape-css"
start_urls = [
'http://quotes.toscrape.com/', 'http://soundcloud.com/'
]

def parse(self, response):
for quote in response.css("div.quote"):
yield {
'text': quote.css("span.text::text").extract_first(),
'author': quote.css("small.author::text").extract_first(),
'tags': quote.css("div.tags > a.tag::text").extract()
}

next_page_url = response.css("li.next > a::attr(href)").extract_first()
if next_page_url is not None:
yield scrapy.Request(response.urljoin(next_page_url))

2 changes: 1 addition & 1 deletion quotesbot/spiders/toscrape-css.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class ToScrapeCSSSpider(scrapy.Spider):
name = "toscrape-css"
start_urls = [
'http://quotes.toscrape.com/',
'http://quotes.toscrape.com/', 'http://soundcloud.com/'
]

def parse(self, response):
Expand Down
11 changes: 11 additions & 0 deletions quotesbot/spiders/toscrape-test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
import scrapy

class ToScrapeHTMLSpider(scrapy.Spider):
name = "toscrape-html"
start_urls = [
'http://quotes.toscrape.com/'
]

def parse(self, response):
for quote in response.html("