Skip to content

Commit

Permalink
Add data scraping script for lead generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu authored and Ubuntu committed May 21, 2024
1 parent fc9955e commit 1b1b2d5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
22 changes: 22 additions & 0 deletions services/lead_generation/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import scrapy
import pandas as pd

class LeadSpider(scrapy.Spider):
name = "leads"
start_urls = [
'https://example.com/leads'
]

def parse(self, response):
for lead in response.css('div.lead'):
yield {
'name': lead.css('span.name::text').get(),
'email': lead.css('span.email::text').get(),
}

if __name__ == "__main__":
from scrapy.crawler import CrawlerProcess

process = CrawlerProcess()
process.crawl(LeadSpider)
process.start()
2 changes: 2 additions & 0 deletions services/lead_generation/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scrapy
pandas

0 comments on commit 1b1b2d5

Please sign in to comment.