我如何让Scrapy抓取此站点的下一页?

pnwntuvh  于 2023-03-02  发布在  其他
关注(0)|答案(1)|浏览(184)

这是我目前为止的代码。我想循环通过这个网站上所有剩余的页面,并刮每一个,然后把所有的输出到一个。csv文件。

import scrapy
# No unneeded imports

class BillingsorgSpider(scrapy.Spider):
    name = "billingsorg"
    allowed_domains = ["billings.org"]
    start_urls = ['https://www.billings.org/agents/']

    def parse(self, response):
        # iterate through each of the realtors
        for staff in response.css('div.staff-capsule'):
            # gather contact information for each realtor
            item = {
                'name': staff.xpath('.//h3//text()').get().strip(),
                'phone': ''.join(staff.xpath('.//div[@class="staff-phone"]//text()').getall()).strip(),
                'email': staff.xpath('.//div[@class="staff-email"]//a/@href').get(),
                'company': ''.join(staff.xpath('.//div[@class="staff-company"]//text()').getall()).strip()
            }
            print(item)  # print the item here in the scope of the method
            yield item   # yield to output processor
hec6srdp

hec6srdp1#

分页的方法是使用a[@class="btn btn-info"]的xpath获取当前页面元素,然后使用当前页面链接的相对xpath获取下一页的兄弟元素,然后比较这两个链接以了解何时到达最后一页,然后将链接放入一个新的scrapy请求并将其返回给调度程序。
例如:

import scrapy

class BillingsorgSpider(scrapy.Spider):
    name = "billingsorg"
    allowed_domains = ["billings.org"]
    start_urls = ['https://www.billings.org/agents/']

    def parse(self, response):
        for staff in response.css('div.staff-capsule'):
            item = {
                'name': staff.xpath('.//h3//text()').get().strip(),
                'phone': ''.join(staff.xpath('.//div[@class="staff-phone"]//text()').getall()).strip(),
                'email': staff.xpath('.//div[@class="staff-email"]//a/@href').get(),
                'company': ''.join(staff.xpath('.//div[@class="staff-company"]//text()').getall()).strip()
            }
            yield item
        current_page = response.xpath("//a[@class='btn btn-info']")
        next_page = current_page.xpath("./following-sibling::a/@href").get()
        if next_page and next_page != current_page.xpath('./@href').get():
            yield scrapy.Request(response.urljoin(next_page))

输出

{'name': 'Cari Baxter', 'phone': '406-671-1675', 'email': 'mailto:cari.baxter59105@gmail.com', 'company': 'Real Estate Hub LLLP'}
2023-02-28 13:31:21 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/7/>
{'name': 'Cari Baxter', 'phone': '406-671-1675', 'email': 'mailto:cari.baxter59105@gmail.com', 'company': 'Real Estate Hub LLLP'}
{'name': 'Linda Beach', 'phone': '406-425-0808', 'email': 'mailto:beach.lin@gmail.com', 'company': 'LHB Appraisal Service'}
2023-02-28 13:31:21 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/7/>
{'name': 'Linda Beach', 'phone': '406-425-0808', 'email': 'mailto:beach.lin@gmail.com', 'company': 'LHB Appraisal Service'}
{'name': 'Dallas Bedford', 'phone': '406-839-3311', 'email': 'mailto:dallas@bedfordandassociates.com', 'company': 'Real Estate Services'}
2023-02-28 13:31:21 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/7/>
{'name': 'Dallas Bedford', 'phone': '406-839-3311', 'email': 'mailto:dallas@bedfordandassociates.com', 'company': 'Real Estate Services'}
{'name': 'Kylee Beery', 'phone': '406-366-6399', 'email': 'mailto:kyleebeery@gmail.com', 'company': 'MB Realty'}
2023-02-28 13:31:21 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/7/>
{'name': 'Kylee Beery', 'phone': '406-366-6399', 'email': 'mailto:kyleebeery@gmail.com', 'company': 'MB Realty'}
{'name': 'Robert Beery', 'phone': '406-478-3568', 'email': 'mailto:rjbeery@hotmail.com', 'company': 'Yellowstone Real Estate Professionals'}
2023-02-28 13:31:21 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/7/>
{'name': 'Robert Beery', 'phone': '406-478-3568', 'email': 'mailto:rjbeery@hotmail.com', 'company': 'Yellowstone Real Estate Professionals'}
2023-02-28 13:31:21 [scrapy.downloadermiddlewares.redirect] DEBUG: Redirecting (301) to <GET https://www.billings.org/agents/page/8/> from <GET https://www.billings.org/agents/page/8>
2023-02-28 13:31:22 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://www.billings.org/agents/page/8/> (referer: https://www.billings.org/agents/page/7/)
{'name': 'Nicole Beeton', 'phone': '406-690-2569', 'email': 'mailto:nicole@nicolebeeton.com', 'company': 'Western Skies Real Estate'}
2023-02-28 13:31:22 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/8/>
{'name': 'Nicole Beeton', 'phone': '406-690-2569', 'email': 'mailto:nicole@nicolebeeton.com', 'company': 'Western Skies Real Estate'}
{'name': 'Connie Begger', 'phone': '406-850-3269', 'email': 'mailto:conniebeggermt@gmail.com', 'company': 'Select Property Brokers'}
2023-02-28 13:31:22 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/8/>
{'name': 'Connie Begger', 'phone': '406-850-3269', 'email': 'mailto:conniebeggermt@gmail.com', 'company': 'Select Property Brokers'}
{'name': 'Vicki Beley', 'phone': '406-853-8545', 'email': 'mailto:vicki@davesmithrealty.com', 'company': 'Dave Smith Realty'}
2023-02-28 13:31:22 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/8/>
{'name': 'Vicki Beley', 'phone': '406-853-8545', 'email': 'mailto:vicki@davesmithrealty.com', 'company': 'Dave Smith Realty'}
{'name': 'Carissa Belless', 'phone': '406-855-2156', 'email': 'mailto:realestatebycarissa@gmail.com', 'company': 'Magic City Real Estate'}
2023-02-28 13:31:22 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/8/>
{'name': 'Carissa Belless', 'phone': '406-855-2156', 'email': 'mailto:realestatebycarissa@gmail.com', 'company': 'Magic City Real Estate'}
{'name': 'Angela Belus', 'phone': '406-853-5034', 'email': 'mailto:angela.belus@outlook.com', 'company': 'MB Realty'}
2023-02-28 13:31:22 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/8/>
{'name': 'Angela Belus', 'phone': '406-853-5034', 'email': 'mailto:angela.belus@outlook.com', 'company': 'MB Realty'}
{'name': 'Jon Bengochea', 'phone': '406-263-5662', 'email': 'mailto:jben@nemont.net', 'company': 'United Insurance & Realty'}
2023-02-28 13:31:22 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/8/>
{'name': 'Jon Bengochea', 'phone': '406-263-5662', 'email': 'mailto:jben@nemont.net', 'company': 'United Insurance & Realty'}
{'name': 'James Benner', 'phone': '406-265-2182', 'email': 'mailto:james.benner@exprealty.com', 'company': 'eXp Realty, LLC'}
2023-02-28 13:31:22 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/8/>
{'name': 'James Benner', 'phone': '406-265-2182', 'email': 'mailto:james.benner@exprealty.com', 'company': 'eXp Realty, LLC'}
{'name': 'Earl Bennett', 'phone': '406-861-1700                                    \r\n                                        \r\n                                        406-245-4349', 'email': 'mailto:earl_b_59105@yahoo.com', 'c
ompany': 'Bennett Realty'}
2023-02-28 13:31:22 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/8/>
{'name': 'Earl Bennett', 'phone': '406-861-1700                                    \r\n                                        \r\n                                        406-245-4349', 'email': 'mailto:earl_b_59105@yahoo.com', 'c
ompany': 'Bennett Realty'}
{'name': 'Kim Bennett', 'phone': '406-539-4924', 'email': 'mailto:kim@terrawestern.com', 'company': 'Terra Western Associates'}
2023-02-28 13:31:22 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/8/>
{'name': 'Kim Bennett', 'phone': '406-539-4924', 'email': 'mailto:kim@terrawestern.com', 'company': 'Terra Western Associates'}
2023-02-28 13:31:22 [scrapy.downloadermiddlewares.redirect] DEBUG: Redirecting (301) to <GET https://www.billings.org/agents/page/9/> from <GET https://www.billings.org/agents/page/9>
2023-02-28 13:31:23 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://www.billings.org/agents/page/9/> (referer: https://www.billings.org/agents/page/8/)
{'name': 'Mona Bennett-Abelseth', 'phone': '406-671-2876', 'email': 'mailto:monamovesmt@gmail.com', 'company': 'eXp Realty, LLC'}
2023-02-28 13:31:23 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/9/>
{'name': 'Mona Bennett-Abelseth', 'phone': '406-671-2876', 'email': 'mailto:monamovesmt@gmail.com', 'company': 'eXp Realty, LLC'}
{'name': 'Heidi Benson', 'phone': '406-794-8890', 'email': 'mailto:heidi.b@kw.com', 'company': 'Keller Williams Yellowstone Properties'}
2023-02-28 13:31:23 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/9/>
{'name': 'Heidi Benson', 'phone': '406-794-8890', 'email': 'mailto:heidi.b@kw.com', 'company': 'Keller Williams Yellowstone Properties'}
{'name': 'Jeffrey Bent', 'phone': '406-579-4977', 'email': 'mailto:jeffbent7@yahoo.com', 'company': 'Obsidian Realty Group'}
2023-02-28 13:31:23 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/9/>
{'name': 'Jeffrey Bent', 'phone': '406-579-4977', 'email': 'mailto:jeffbent7@yahoo.com', 'company': 'Obsidian Realty Group'}
{'name': 'Andrew Beres', 'phone': '406-425-3236', 'email': 'mailto:andy@cbthebrokers.com', 'company': 'Coldwell Banker The Brokers RL'}
2023-02-28 13:31:23 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/9/>
{'name': 'Andrew Beres', 'phone': '406-425-3236', 'email': 'mailto:andy@cbthebrokers.com', 'company': 'Coldwell Banker The Brokers RL'}
{'name': 'Jeff Berger', 'phone': '406-970-4034', 'email': 'mailto:jeffbsellsmt@gmail.com', 'company': 'NextHome Peaks to Prairie'}
2023-02-28 13:31:23 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/9/>
{'name': 'Jeff Berger', 'phone': '406-970-4034', 'email': 'mailto:jeffbsellsmt@gmail.com', 'company': 'NextHome Peaks to Prairie'}
{'name': 'Amy Berry', 'phone': '406-861-1884', 'email': 'mailto:amyberrymt@gmail.com', 'company': 'Metro, REALTORS L.L.P'}
2023-02-28 13:31:23 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/9/>
{'name': 'Amy Berry', 'phone': '406-861-1884', 'email': 'mailto:amyberrymt@gmail.com', 'company': 'Metro, REALTORS L.L.P'}
{'name': 'Brandon Bertrand', 'phone': '406-671-4609', 'email': 'mailto:brandonmbertrand@msn.com', 'company': 'Trusthaven Real Estate'}
2023-02-28 13:31:23 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/9/>
{'name': 'Brandon Bertrand', 'phone': '406-671-4609', 'email': 'mailto:brandonmbertrand@msn.com', 'company': 'Trusthaven Real Estate'}
{'name': 'Samantha Best', 'phone': '406-242-0296', 'email': 'mailto:sbestrealitymt@kw.com', 'company': 'Keller Williams Yellowstone Properties'}
2023-02-28 13:31:23 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/9/>
{'name': 'Samantha Best', 'phone': '406-242-0296', 'email': 'mailto:sbestrealitymt@kw.com', 'company': 'Keller Williams Yellowstone Properties'}
{'name': 'Twyla Best', 'phone': '406-591-9191', 'email': 'mailto:twylab10@gmail.com', 'company': 'Metro, REALTORS L.L.P'}
2023-02-28 13:31:23 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/9/>
{'name': 'Twyla Best', 'phone': '406-591-9191', 'email': 'mailto:twylab10@gmail.com', 'company': 'Metro, REALTORS L.L.P'}
2023-02-28 13:31:23 [scrapy.downloadermiddlewares.redirect] DEBUG: Redirecting (301) to <GET https://www.billings.org/agents/page/10/> from <GET https://www.billings.org/agents/page/10>
2023-02-28 13:31:24 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://www.billings.org/agents/page/10/> (referer: https://www.billings.org/agents/page/9/)
{'name': 'Neil Beyer', 'phone': '406-272-6568', 'email': 'mailto:neil@elephasre.com', 'company': 'eXp Realty, LLC'}
2023-02-28 13:31:24 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/10/>
{'name': 'Neil Beyer', 'phone': '406-272-6568', 'email': 'mailto:neil@elephasre.com', 'company': 'eXp Realty, LLC'}
{'name': 'Alexis Bidlake', 'phone': '406-702-0914', 'email': 'mailto:alexis.bidlakec21@gmail.com', 'company': 'Century 21 Hometown Brokers'}
2023-02-28 13:31:24 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/10/>
{'name': 'Alexis Bidlake', 'phone': '406-702-0914', 'email': 'mailto:alexis.bidlakec21@gmail.com', 'company': 'Century 21 Hometown Brokers'}
{'name': 'John Bidlake', 'phone': '406-860-4567                                    \r\n                                        \r\n                                        406-656-5407', 'email': 'mailto:john@billingsinsurance.com'
, 'company': 'Bidlake & Associates'}
2023-02-28 13:31:24 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/10/>
{'name': 'John Bidlake', 'phone': '406-860-4567                                    \r\n                                        \r\n                                        406-656-5407', 'email': 'mailto:john@billingsinsurance.com'
, 'company': 'Bidlake & Associates'}
{'name': 'Rhonda Bidlake', 'phone': '406-860-4568', 'email': 'mailto:rhonda@billingsinsurance.com', 'company': 'Bidlake & Associates'}
2023-02-28 13:31:24 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/10/>
{'name': 'Rhonda Bidlake', 'phone': '406-860-4568', 'email': 'mailto:rhonda@billingsinsurance.com', 'company': 'Bidlake & Associates'}
{'name': 'Jerred Bies', 'phone': '406-600-0449', 'email': 'mailto:jerred@mccalldevelopment.com', 'company': 'McCall Real Estate'}
2023-02-28 13:31:24 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/10/>
{'name': 'Jerred Bies', 'phone': '406-600-0449', 'email': 'mailto:jerred@mccalldevelopment.com', 'company': 'McCall Real Estate'}
{'name': 'Jeanne Bilile', 'phone': '406-672-1757', 'email': 'mailto:jeanneb1757@gmail.com', 'company': 'Keller Williams Yellowstone Properties'}
2023-02-28 13:31:24 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/10/>
{'name': 'Jeanne Bilile', 'phone': '406-672-1757', 'email': 'mailto:jeanneb1757@gmail.com', 'company': 'Keller Williams Yellowstone Properties'}
{'name': 'Alexandra Blair', 'phone': '406-210-5490', 'email': 'mailto:AlexandraBlairRealEstate@gmail.com', 'company': 'Real Estate Hub LLLP'}
2023-02-28 13:31:24 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/10/>
{'name': 'Alexandra Blair', 'phone': '406-210-5490', 'email': 'mailto:AlexandraBlairRealEstate@gmail.com', 'company': 'Real Estate Hub LLLP'}
{'name': 'Sarah Blatchford', 'phone': '406-698-9080', 'email': 'mailto:ksblatchford@gmail.com', 'company': 'North Acre Real Estate'}
2023-02-28 13:31:24 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/10/>
{'name': 'Sarah Blatchford', 'phone': '406-698-9080', 'email': 'mailto:ksblatchford@gmail.com', 'company': 'North Acre Real Estate'}
{'name': 'Bernadette Blaylock', 'phone': '406-855-1397', 'email': 'mailto:bern15@aaarealty.com', 'company': 'A A A Realty, Inc.'}
2023-02-28 13:31:24 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/10/>
{'name': 'Bernadette Blaylock', 'phone': '406-855-1397', 'email': 'mailto:bern15@aaarealty.com', 'company': 'A A A Realty, Inc.'}
2023-02-28 13:31:24 [scrapy.downloadermiddlewares.redirect] DEBUG: Redirecting (301) to <GET https://www.billings.org/agents/page/11/> from <GET https://www.billings.org/agents/page/11>
2023-02-28 13:31:25 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://www.billings.org/agents/page/11/> (referer: https://www.billings.org/agents/page/10/)
{'name': 'Chet Blotske', 'phone': '406-694-3065', 'email': 'mailto:chet@summitrealestatemt.com', 'company': 'Real Estate Hub LLLP'}
2023-02-28 13:31:25 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/11/>
{'name': 'Chet Blotske', 'phone': '406-694-3065', 'email': 'mailto:chet@summitrealestatemt.com', 'company': 'Real Estate Hub LLLP'}
{'name': 'Leanne Bodell', 'phone': '406-439-6904', 'email': 'mailto:leanne.bodell@bhhsmt.com', 'company': 'Berkshire Hathaway HomeServices Montana Properties'}
2023-02-28 13:31:25 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/11/>
{'name': 'Leanne Bodell', 'phone': '406-439-6904', 'email': 'mailto:leanne.bodell@bhhsmt.com', 'company': 'Berkshire Hathaway HomeServices Montana Properties'}
{'name': 'Jennifer Bodine', 'phone': '406-670-1676', 'email': 'mailto:jenniferbodinerealestate@gmail.com', 'company': 'Century 21 Hometown Brokers'}
2023-02-28 13:31:25 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/11/>
{'name': 'Jennifer Bodine', 'phone': '406-670-1676', 'email': 'mailto:jenniferbodinerealestate@gmail.com', 'company': 'Century 21 Hometown Brokers'}
{'name': 'Trevor Bogunovich', 'phone': '406-208-2280', 'email': 'mailto:sjbogun@live.com', 'company': 'Fenton Enterprises'}
2023-02-28 13:31:25 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/11/>
{'name': 'Trevor Bogunovich', 'phone': '406-208-2280', 'email': 'mailto:sjbogun@live.com', 'company': 'Fenton Enterprises'}
{'name': 'Kelly Bohnet-Erickson', 'phone': '406-861-5355                                    \r\n                                        \r\n                                        406-656-9999', 'email': 'mailto:kelly.remax.reales
tate@gmail.com', 'company': 'RE/MAX Experts'}
2023-02-28 13:31:25 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/11/>
{'name': 'Kelly Bohnet-Erickson', 'phone': '406-861-5355                                    \r\n                                        \r\n                                        406-656-9999', 'email': 'mailto:kelly.remax.reales
tate@gmail.com', 'company': 'RE/MAX Experts'}
{'name': 'Charity Boller', 'phone': '406-697-7036', 'email': 'mailto:cboller0976@gmail.com', 'company': 'Premier Realty'}
2023-02-28 13:31:25 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/11/>
{'name': 'Charity Boller', 'phone': '406-697-7036', 'email': 'mailto:cboller0976@gmail.com', 'company': 'Premier Realty'}
{'name': 'Lauren Bond', 'phone': '406-699-0200                                    \r\n                                        \r\n                                        406-800-1222', 'email': 'mailto:agentlaurenbond@gmail.com',
'company': 'THE Agency Montana, LLC'}
2023-02-28 13:31:25 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/11/>
{'name': 'Lauren Bond', 'phone': '406-699-0200                                    \r\n                                        \r\n                                        406-800-1222', 'email': 'mailto:agentlaurenbond@gmail.com',
'company': 'THE Agency Montana, LLC'}
{'name': 'Duncan Bonine', 'phone': '307-254-0533', 'email': 'mailto:duncan@dbwrealty.com', 'company': 'DBW Realty, Inc.'}
2023-02-28 13:31:25 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/11/>
{'name': 'Duncan Bonine', 'phone': '307-254-0533', 'email': 'mailto:duncan@dbwrealty.com', 'company': 'DBW Realty, Inc.'}
{'name': 'Brandon Booty', 'phone': '406-697-9622', 'email': 'mailto:brandon@41realtygroup.com', 'company': '41 Realty Group'}
2023-02-28 13:31:25 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/11/>
{'name': 'Brandon Booty', 'phone': '406-697-9622', 'email': 'mailto:brandon@41realtygroup.com', 'company': '41 Realty Group'}
2023-02-28 13:31:26 [scrapy.downloadermiddlewares.redirect] DEBUG: Redirecting (301) to <GET https://www.billings.org/agents/page/12/> from <GET https://www.billings.org/agents/page/12>
2023-02-28 13:31:26 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://www.billings.org/agents/page/12/> (referer: https://www.billings.org/agents/page/11/)
{'name': 'Brian Borich', 'phone': '406-861-4945', 'email': 'mailto:b.borich@yahoo.com', 'company': 'ERA American Real Estate'}
2023-02-28 13:31:27 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/12/>
{'name': 'Brian Borich', 'phone': '406-861-4945', 'email': 'mailto:b.borich@yahoo.com', 'company': 'ERA American Real Estate'}
{'name': 'Kevin Bos', 'phone': '406-661-3184', 'email': 'mailto:appraisalinsp2@gmail.com', 'company': 'Appraisal Inspection Services'}
2023-02-28 13:31:27 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/12/>
{'name': 'Kevin Bos', 'phone': '406-661-3184', 'email': 'mailto:appraisalinsp2@gmail.com', 'company': 'Appraisal Inspection Services'}
{'name': 'Troy Boucher', 'phone': '406-855-6998', 'email': 'mailto:montanareo@gmail.com', 'company': 'Boucher & Associates'}
2023-02-28 13:31:27 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/12/>
{'name': 'Troy Boucher', 'phone': '406-855-6998', 'email': 'mailto:montanareo@gmail.com', 'company': 'Boucher & Associates'}
{'name': 'Sarah Boughton', 'phone': '406-577-2520', 'email': 'mailto:sarah@buildingbozeman.com', 'company': 'Aspire Realty'}
2023-02-28 13:31:27 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/12/>
{'name': 'Sarah Boughton', 'phone': '406-577-2520', 'email': 'mailto:sarah@buildingbozeman.com', 'company': 'Aspire Realty'}
{'name': 'Chaney Bowen', 'phone': '406-633-5479', 'email': 'mailto:bowenhh@gmail.com', 'company': 'Coldwell Banker The Brokers'}
2023-02-28 13:31:27 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/12/>
{'name': 'Chaney Bowen', 'phone': '406-633-5479', 'email': 'mailto:bowenhh@gmail.com', 'company': 'Coldwell Banker The Brokers'}
{'name': 'Damon Bower', 'phone': '406-670-8555', 'email': 'mailto:dbcllcmt@gmail.com', 'company': 'Century 21 Hometown Brokers'}
2023-02-28 13:31:27 [scrapy.core.scraper] DEBUG: Scraped from <200 https://www.billings.org/agents/page/12/>
{'name': 'Damon Bower', 'phone': '406-670-8555', 'email': 'mailto:dbcllcmt@gmail.com', 'company': 'Century 21 Hometown Brokers'}

这只是部分结果,但您可以在第7 - 11页的url中看到它解析的结果

相关问题