<jupyter_start><jupyter_text>__Web Srcaping Assignment__ __Submitted by:-____Name:- <NAME>____Reg.no :- 19111544____Class :- 4BBA-C__<jupyter_code>#Libraries imported
import requests
from selenium import webdriver
from bs4 import BeautifulSoup
import time
import pandas as pd
from webdriver_manager.chrome import ChromeDriverManager
url=("https://www.naukri.com/financial-analyst-jobs-in-mumbai?k=financial%20analyst&l=mumbai")
page = requests.get(url)
page.text
driver = webdriver.Chrome(ChromeDriverManager().install())
driver.get(url)
time.sleep(3)
soup = BeautifulSoup(driver.page_source,'html5lib')
print(soup.prettify())
driver.close()
df = pd.DataFrame(columns=['Title','Company','Ratings','Reviews','Experience','Salary','Location','Job_Post_History','URL'])
results = soup.find(class_='list')
results
job_elems = results.find_all('article',class_='jobTuple bgWhite br4 mb-8')

for param in range(1,11):
    url = "https://www.naukri.com/financial-analyst-jobs-in-mumbai-param?k=financial%20analyst&l=mumbai"

    driver = webdriver.Chrome(ChromeDriverManager().install())
    driver.get(url)

    time.sleep(10)

    soup = BeautifulSoup(driver.page_source,'html5lib')

    # print(soup.prettify())

    driver.close()

    results = soup.find(class_='list')
    job_elems = results.find_all('article',class_='jobTuple bgWhite br4 mb-8')


#Links for applying for the job

for job_elem in job_elems:

        # URL to apply for the job     
        URL = job_elem.find('a',class_='title fw500 ellipsis').get('href')
    #     print(URL.strip())

        # Post Title
        Title = job_elem.find('a',class_='title fw500 ellipsis')

        # Company Name
        Company = job_elem.find('a',class_='subTitle ellipsis fleft')

        # Ratings
        rating_span = job_elem.find('span',class_='starRating fleft dot')
        if rating_span is None:
            continue
        else:
            Ratings = rating_span.text

        # Reviews Counts
        Review_span = job_elem.find('a',class_='reviewsCount ml-5 fleft blue-text')
        if Review_span is None:
            continue
        else:
            Reviews = Review_span.text

        # Years of experience Required
        Exp = job_elem.find('li',class_='fleft grey-text br2 placeHolderLi experience')
        Exp_span = Exp.find('span',class_='ellipsis fleft fs12 lh16')
        if Exp_span is None:
            continue
        else:
            Experience = Exp_span.text

        # Salary offered for the job
        Sal = job_elem.find('li',class_='fleft grey-text br2 placeHolderLi salary')
        Sal_span = Sal.find('span',class_='ellipsis fleft fs12 lh16')
        if Sal_span is None:
            continue
        else:
            Salary = Sal_span.text

        # Location for the job post
        Loc = job_elem.find('li',class_='fleft grey-text br2 placeHolderLi location')
        Loc_exp = Loc.find('span',class_='ellipsis fleft fs12 lh16')
        if Loc_exp is None:
            continue
        else:
            Location = Loc_exp.text

        # Number of days since job posted
        Hist = job_elem.find("div",["type br2 fleft grey","type br2 fleft green"])
        Post_Hist = Hist.find('span',class_='fleft fw500')
        if Post_Hist is None:
            continue
        else:
            Post_History = Post_Hist.text

    #   Appending data to the DataFrame 
        df=df.append({'URL':URL,'Title':Title.text,'Company':Company.text,'Ratings':Ratings,'Reviews':Reviews,'Experience':Experience,'Salary':Salary,'Location':Location,'Job_Post_History':Post_History},ignore_index = True)
df<jupyter_output><empty_output><jupyter_text>__Statistical Description__<jupyter_code>df.columns
df.shape
df.info<jupyter_output><empty_output><jupyter_text>__Scarped Location of the Jobs__<jupyter_code>Company_loc = df['Location']
Company_loc<jupyter_output><empty_output><jupyter_text>__Scraped Salary details__<jupyter_code>Salary_Det= df['Salary']
Salary_Det<jupyter_output><empty_output><jupyter_text>__Scarped Company name__<jupyter_code>Company_name= df['Company']
Company_name<jupyter_output><empty_output><jupyter_text>__Scraped Name of Company with maximum jobs offered__<jupyter_code>column=df['Company']
column.max()

#Most of the jobs are offered by 'WORLEY SERVICES INDIA PRIVATE LIMITED'<jupyter_output><empty_output><jupyter_text>__Converted the Data into csv file__<jupyter_code>df.to_csv(r"C:\Users\hp\Desktop\Naukri.com_data.csv",index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11688601383002453, 'fraction_numerical': 0.01182244033013607, 'mean_word_length': 3.900546448087432, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '529183', 'license': 'Apache-2.0', 'n_tokens_mistral': 1529, 'n_tokens_neox': 1460, 'n_words': 279, 'path': 'Web scraping Naukri.com.ipynb', 'repo_name': 'H2001-hj/Web-Scraping-using-Python-Jupyter-Notebook', 'size': '4492'}