1import requests
2from bs4 import BeautifulSoup
3
4URL = 'https://www.monster.com/jobs/search/?q=Software-Developer&where=Australia'
5page = requests.get(URL)
6
7soup = BeautifulSoup(page.content, 'html.parser')
8
1import scrapy
2from ..items import SampletestItem #items class
3
4class QuoteTestSpider(scrapy.Spider):
5 name = 'quote_test'
6 start_urls = ['https://quotes.toscrape.com/']
7
8 def parse(self, response):
9 items = SampletestItem() #items class
10 quotes = response.css("div.quote")
11 for quote in quotes:
12 items['title'] = quote.css("span.text::text").get()
13 items['author'] = quote.css(".author::text").get()
14 items['tags'] = quote.css(".tags .tag::text").getall()
15
16 yield items
17 next_page = response.css(".next a::attr(href)").get()
18 if next_page is not None:
19 next_url = response.urljoin(next_page)
20 yield scrapy.Request(next_url, callback=self.parse)