GithubHelp home page GithubHelp logo

terrankartiktellus / web-scraping Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 255 KB

All about scraping domains from the 'World Wide Web'

Python 100.00%
web-scraper beautifulsoup4 python-web-scraper python-web-scraping python-webscraping-application requests scraper timesjob web-scraping web-scraping-python

web-scraping's Introduction

Web-Scraping

Get latest job postings from timesjobs.com


$ Instructions to execute

1. Install dependencies
pip install BeautifulSoup4
pip install requests
pip install time
2. Move to directory where main.py exist
2. Run main.py
python main.py

$ Output

1. open /posts/saved.txt file

$ PythonCode

from bs4 import BeautifulSoup
import requests
import time

urls = "https://www.timesjobs.com/candidate/job-search.html?searchType=personalizedSearch&from=submit&txtKeywords=python&txtLocation="

def findJobs():
  count=0
  html_text = requests.get(urls).text;
  soup = BeautifulSoup(html_text, 'lxml')

  jobs = soup.find_all('li', class_="clearfix job-bx wht-shd-bx")

  with open(f'posts/saved.txt','w') as f:
   for index, job in enumerate(jobs):
    location = job.find('ul', class_="top-jd-dtl clearfix").span.text
    skills = job.find('ul', class_="list-job-dtl clearfix").span.text
    company = job.find('h3', class_="joblist-comp-name").text
    link = job.find('header', class_="clearfix").h2.a['href']
    
    if True:
        count+=1
        f.write(f"Company: {company.strip().replace('(More Jobs)','')}\n")
        f.write(f"Location: {location.strip()}\n")
        f.write(f"Skills: {skills.strip()}\n")
        f.write(f"Link: {link}\n\n")
  return count;
    
print(f'Fetching Data from\n{urls}\n.')
x = findJobs()
print(f'{x} new jobs updated.')

web-scraping's People

Contributors

terrankartiktellus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

xwuwux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.