• Teaching
    • Montessori Teacher Training 🔥
    • Yoga Teacher Training
  • Coding
    • Full Stack Development Course
    • Data Science Course
    • Python Programming Course
    • Software Testing Course
    • Architecting on AWS
  • Commerce
    • PwC Edge : Strategic Accounting and Finance Programme
    • ACCA Course
    • SAP Fico Course
    • Practical Accounting Course
    • SAP MM Course
    • HR Management Course in Kerala
  • Technical
    • Structural Design Course
    • Embedded Systems Software Engineering in Kerala
    • MEP Course
    • MEP QS Course
    • BIM Training Course
    • Quantity Survey Course
  • Finacademy
    • Forex Trading Course
    • Stock Market Course
    • Mutual Funds Course in Kerala
  • Digital Marketing
    • Digital Marketing Course
    • Performance Marketing Course
  • Language Learning
    • Spoken English Course
    • German Language Course
    • IELTS Exam Coaching
  • Exam Preparation
    • Kerala PSC Coaching
    • Kerala PSC LGS Coaching
    • KAS Coaching
    • Kerala PSC LDC Coaching
    • Kerala PSC LSGS Coaching
    • KPSC Industries Extension Officer Coaching
    • KPSC Technical Mechanical Coaching
    • KPSC Technical Electrical Coaching
    • Kerala PSC Technical Exam Preparation
    • KPSC Technical Civil Coaching
    • SBI PO Coaching
    • IBPS Clerk Coaching
    • IBPS PO Coaching
    • IBPS SO Coaching
    • Bank Exam Coaching
    • Lecturer in DIET Course
    • Kpsc HSA Coaching
    • KPSC LP UP Assistant Coaching
    • EMRS Coaching
    • KTET Coaching
    • SSC Coaching
    • SSC JE Coaching
    • SSC CGL Coaching
    • SSC CHSL Coaching
    • SSC MTS Coaching
    • UPSC Coaching
  • Health Care
    • DHA Course
    • OET Coaching
  • Other Exams
    • GATE Coaching
    • CAT Coaching
    • MAT Online Coaching
    • KMAT Online Coaching
Entri Blog
No Result
View All Result
Wednesday, May 14, 2025
  • Kerala PSC
    • Kerala PSC General
      • Kerala PSC Exams
      • KAS Exam
      • Kerala PSC VEO Notification
      • Kerala Police SI
      • Kerala PSC LDC Notification
      • Kerala PSC Village Field Assistant Notification
      • Kerala PSC LD Typist Notification
      • Kerala PSC Food Safety Officer
      • Kerala PSC Excise Inspector Notification
      • Kerala PSC BDO Notification
      • Kerala PSC CPO Notification
      • Kerala PSC LGS Notification
      • Fire and Rescue Officer
      • Women Fire and Rescue Officer
    • Kerala PSC Teaching
      • Kerala PSC HSA
      • Kerala PSC HSST
      • KTET
      • LP/UP Assistant
      • KVS
      • Railway Teacher
    • Kerala PSC Technical
      • LSGD AE
      • Draftsman/Overseer
      • IEO
      • ATP
      • Polytechnic Lecturer
      • AE Electronics
      • Assistant Engineer
  • Banking
    • IBPS PO Notification
    • IBPS Clerk Notification
    • SBI PO Notification
    • SBI Clerk Notification
    • SBI SO Notification
    • SBI Apprentice Notification
    • Canara Bank PO Notification
    • Indian Bank PO Notification
    • RBI Assistant Notification
    • RBI Office Attendant Notification
    • IBPS RRB Notification
    • IBPS RRB Office Assistant Notification
  • Skilling
    • Coding
    • Spoken English
    • Stock Market
      • Share Market Today News
      • Share Market Analysis
    • Digital Marketing
    • Accounting Course
    • SAP
    • OET
    • German
    • IELTS
    • Quantity Survey
    • MEP
    • Structural Design
    • Montessori
    • Yoga Teaching
    • Oil and Gas
  • Courses
    • Data Science Course
      • Data Science Malayalam
      • Data Science Course in Tamil
      • Data Science Course in Telugu
      • Data Science Training in Kochi
      • Data Science Training in Trivandrum
      • Data Science Course in Calicut
      • Data Science Training in Thrissur
    • Data Analytics Course
      • Data Analytics Course in Malayalam
      • Data Analytics Course in Tamil
      • Data Analytics Course in Telugu
    • Technical Upskilling
      • Quantity Surveying Course
      • Structural Design Course
      • BIM Course in Kerala
      • MEP Course
      • Embedded System Course
      • MEP Quantity Surveying Course
      • MEP Course in Kochi
      • Quantity Surveyor Course in Tamil
      • Quantity Surveying Course in Telugu
      • Quantity Surveyor Course in Hyderabad
      • Quantity Surveying Course in Chennai
      • MEP Design Course in Kerala
      • HVAC Course
      • Steel Structure Design Course
      • RCC Design Course
    • Full Stack Developer Course
      • Full Stack Development Malayalam
      • Full Stack Development Hindi
      • Full Stack Development Tamil
      • Full Stack Development Telugu
      • Full Stack Development Kannada
    • Stock Market Course
      • Stock Market Course in Malayalam
      • Stock Market Course in Tamil
      • Stock Market Course in Kannada
      • Options Trading Course
    • Mutual Funds Course
    • Forex Trading Course
    • Spoken English Course
      • Spoken English Course in Malayalam
      • Spoken English Course in Hindi
      • Spoken English Course in Telugu
      • Spoken English Course in Tamil
      • Spoken English Course in Kannada
    • Python Programming Course
    • Software Testing Course
      • Software Testing Course in Malayalam
      • Software Testing Course in Tamil
      • Software Testing Course in Telugu
    • AWS Solutions Architect Associate Course
    • PwC Edge : Strategic Accounting and Finance Programme
    • Practical Accounting Course
      • Accounting Course in Malayalam
      • Accounting Course in Tamil
      • Tally Course
      • Taxation Course
      • UAE Accounting
      • GST Course
      • Zoho Books Training
      • GST Practitioner Course in Kerala
      • GCC VAT Course
    • ACCA Training Online
      • ACCA Course in Kerala
    • SAP Training Courses
      • SAP FICO Course
      • SAP MM Course
      • SAP SD Training
      • SAP FICO Course in Tamil
      • SAP MM Course in Tamil
    • HR Management Course
    • Performance Marketing Course
    • Mern Stack Developer Course
      • Full Stack Developer Course in Kochi
      • Full Stack Developer Course in Trivandrum
      • Full Stack Developer Course in Calicut
      • Full Stack Developer Course in Pune
      • Full Stack Developer Course in Bangalore
      • Full Stack Developer Course in Hyderabad
      • Full Stack Developer Course in Chennai
      • Full Stack Developer Course in Indore
      • Full Stack Developer Course in Jaipur
      • Full Stack Developer Course in Coimbatore
    • Digital Marketing Training
      • Digital Marketing Course in Kochi
      • Digital Marketing Course in Trivandrum
      • Digital Marketing Course in Calicut
      • Digital Marketing Course in Kollam
      • Digital Marketing Course in Thrissur
      • Digital Marketing Course in Kottayam
      • Digital Marketing Course in Kannur
    • Montessori Teacher Training
      • Montessori Teacher Training in Calicut
      • Montessori Teacher Training in Kochi, Ernakulam
      • Montessori Teacher Training in Trivandrum
      • Montessori Teacher Training in Kollam
      • Montessori Teacher Training in Malayalam
      • Montessori Teacher Training in Kannada
    • Other Courses
      • German Language Course
      • OET Coaching
        • OET for Pharmacist
        • OET for Nurses
      • DHA Course
      • MOH Exam Coaching
      • Nurses Recruitment Abroad
      • FMGE Coaching
      • ChatGPT Course
      • Forex Trading Course
      • Yoga Teacher Training Course
      • Diploma in Early Childhood Care and Education
      • Business Administration & Hospital Management Course
      • Hospital and Healthcare Administration
      • AI for Teachers Course
  • Others
    • Railway
      • RRB Technician Notification
      • RRB JE Notification
      • RRB ALP Notification
      • RRB NTPC Notification
      • RRB RPF Notification
      • RRB RPF SI Notification
      • RRB RPF Constable Notification
      • RRB Group D Notification
      • RRB RPSF SI Notification
      • RRB SSE Notification
    • SSC
      • SSC CPO Notification
      • SSC MTS Notification
      • SSC CGL Notification
      • SSC CHSL Notification
      • SSC GD Constable Notification
      • SSC Stenographer Notification
      • SSC JE Notification
      • SSC CAPF Notification
      • SSC JHT Notification
      • Delhi Police Constable Notification
      • Delhi Police SI Notification
    • GATE
    • MAT
    • KMAT
      • KMAT Kerala 2024
    • TET
      • APTET
      • CTET
      • DSSSB
      • Karnataka TET
      • Kerala TET
        • KTET Notification
      • KVS
      • MPTET
      • SUPER TET
      • TNTET
      • TSTET
      • UPTET
    • UPSC
      • UPSC CAPF Notification
      • UPSC CDS Notification
      • UPSC NDA Notification
      • UPSC Civil service Notification
  • Free Learn
    • Free Courses
      • Free Coding Courses
        • C Langauge Courses
        • Free Data Science Courses
        • Free Full Stack Developer Courses
        • Free Python Programming Courses
      • Free Accounting Courses
      • Free Digital Marketing Courses
        • Free SEO Courses
        • Web Development for Marketers
      • Engineering Upskilling Courses
      • Free Hospital Administration Courses
      • Free OET Training
      • Free SAP Courses
      • Free Teachers Training Courses
      • Free Trading Courses
        • Free Stock Market Courses in Malayalam
        • Free Options Trading Course Malayalam
        • Free Forex Trading Courses Malayalam
        • Free Personal Finance Courses Malayalam
    • Question Answer
    • Aptitude Questions
    • Webinars
  • Test Prep
    • Kerala PSC Coaching
      • KPSC Degree Level Exam Preparation
      • Kerala PSC 12th Level Exam Preparation
      • Kerala PSC 10th Level Exam Preparation
      • KAS Coaching
      • Kerala PSC LDC Coaching
      • Kerala PSC LD Typist Coaching
      • Kerala PSC Fireman Coaching
      • KSFE Assistant Exam Preparation
      • Secretariat Office Attendant Coaching
      • Secretariat Assistant Coaching
      • Kerala PSC SI Exam Coaching
      • Khadi Board LDC Exam Preparation
      • Devaswom Board LDC Coaching
      • University LGS Exam Preparation
      • University Assistant Exam Coaching
      • KPSC Scientific Officer Exam Coaching
      • KPSC Probation Officer Grade II
      • KPSC Food Safety Officer Coaching
      • KWA Sanitary Chemist Coaching
      • KPSC Diary Farm Instructor Exam Coaching
      • Kerala PSC KWA Lab Assistant Exam Coaching
      • Kerala PSC ICDS Supervisor Exam Coaching
      • KPSC Finger Print Searcher Coaching
      • Kerala PSC Welfare Officer Gr. II Exam Coaching
      • KPSC Assistant Dental Surgeon Coaching
    • KPSC Teaching Exams
      • HSA Exam Preparation
      • KPSC HSA Social Science Coaching
      • KPSC HSA Physical Science Coaching
      • KPSC HSA English Coaching
      • KPSC Junior Language Teacher Hindi
      • KTET Coaching
      • SET Coaching
      • LP/UP Assistant Exam Coaching
      • HSST Exam Preparation
      • HSST Commerce Exam Coaching
      • Kerala PSC Lecturer in Diet Coaching
      • KVS PGT/TGT Coaching
    • Kerala PSC Technical Exams Coaching
      • Assistant Engineer Electrical Exam Coaching
      • Assistant Engineer Electronics Coaching
      • Assistant Engineer Mechanical Coaching
      • Kerala PSC Industries Extension Officer Coaching
      • KPSC LSGD AE Exam Coaching
      • KPSC Civil Engineering Exam Coaching
      • KPSC Mechanical Engineering Exam Coaching
      • KPSC Electrical Engineering Exam Coaching
      • KPSC Electronics Engineering Exam Coaching
      • KPSC Technical Computer Science Coaching
      • KPSC Tradesman Turning Coaching
      • Kerala PSC Overseer Exam Coaching
      • KPSC Assistant Town Planner Coaching
      • Lecturer in Polytechnic Electronics Coaching
    • Teaching Exams Coaching
      • CSIR NET Exam Coaching
      • EMRS Coaching
      • CTET Exam Online Coaching
    • IELTS Training Online
    • Bank Exam Coaching Online
      • SEBI Grade A Coaching
      • IBPS SO Online Coaching
      • IBPSC PO Online Coaching
      • IBPSC Clerk Online Coaching
      • SBI PO Coaching
      • SBI Clerk Online Coaching
      • SBI Apprentice Class
      • SBI SO Online Coaching
      • RBI Grade B Coaching
      • RBI Assistant Coaching
      • CSEB Exam Coaching
      • IBPS RRB Coaching
      • IBPS RRB PO Coaching
      • Canara Bank Po Exam Coaching
      • Kerala Gramin Bank Coaching
      • Kerala Bank Exam Coaching
        • Kerala Bank Clerk Exam Coaching
        • Kerala Bank Office Attendant Exam Coaching
        • Kerala Bank Assistant Manager Exam Coaching
      • JCI Exam Coaching
      • NABARD Grade A Coaching
      • LIC AAO Coaching Online
    • UPSC Online Coaching
      • UPSC CAPF Online Coaching
    • SSC Online Coaching
      • SSC JE Online Coaching
      • SSC CGL Coaching
      • SSC CGL AAO Coaching
      • SSC CGL CBI Inspector Coaching
      • SSC CHSL Coaching
      • SSC MTS Coaching
      • SSC Stenographer Coaching
      • SSC GD Online Coaching
    • RRB Exams Coaching
      • RRB RPF Exam Coaching
      • RRB NTPC Exam Coaching
      • RRB JE Online Coaching
      • RRB JE Electronics Coaching
      • RRB ALP Exam Coaching
      • RRB Technician Exam Coaching
    • CAT Online Coaching
    • CMAT Online Coaching
    • XAT Exam Coaching
    • GATE Online Coaching
      • GATE CE Online Coaching
      • GATE ME Online Coaching
      • GATE EE Online Coaching
    • NMAT Exam Coaching
    • AAI ATC Jr Executive Coaching
    • Cochin Shipyard Executive Trainee Coaching
    • BEL Probationary Engineer Coaching
    • HPCL Junior Executive Coaching
Free Courses
Entri Blog
  • HTML Tutorial
  • DSA Tutorials
  • Tutorials in Hindi
    • HTML Tutorial for Beginners in Hindi
    • Python Tutorial for Beginners in Hindi
    • GIT and GITHUB Tutorial for Beginners in Hindi
  • Tutorials in Tamil
    • JavaScript Tutorial in Tamil
  • Tutorials in Telugu
    • HTML Tutorial For Beginners in Telugu
    • CSS Tutorial for Beginners in Telugu
    • Bootstrap Tutorial for Beginner in Telugu
  • Tutorials in Kannada
    • HTML Tutorial For Beginners in Kannada
entri exclusive offers entri exclusive offers
Home Articles

Web Scraping Using Python: Data Science Skills

by Feeba Mahin
June 17, 2022
in Articles, Python Programming
Web Scraping Using Python Data Science Skills
Share on FacebookShare on WhatsAppShare on Telegram

Table of Contents

  • Getting Started
  • Inspect the webpage
  • Parse the webpage html using Beautiful Soup
  • Search for html elements
  • Looping through elements and saving variables
  • Data Cleaning
  • Writing to an output file
  • Summary

Web Scraping is gathering data from websites using code, and is one of the most logical and easily accessible sources of data.

In this  blog , we will go through a simple example of how to scrape a website to gather data on the top 100 companies. Automating this process with a web scraper avoids manual data gathering, saves time and also allows you to have all the data on the companies in one structured file.

Python and Machine Learning Square

Getting Started

For web scraping there are a few different libraries to consider, including:

  • Beautiful Soup
  • Requests
  • Scrapy
  • Selenium

In this example we will be using Beautiful Soup. Using pip, the Python package manager, you can install Beautiful Soup with the following:

pip install BeautifulSoup4

With these libraries installed, let’s get started!

Grab the opportunity to learn Python with Entri! Click Here

Inspect the webpage

1: Which of the following data types is immutable in Python?

2: What does the len() function do in Python?

3: Which keyword is used to define a function in Python?

4: What will print(type([1, 2, 3])) output?

5: Which statement is correct about Python indentation?

    Fill out the form to see the results

    Ever wondered how much you really know? It's time to put your brain to the test!

    To know which elements that you need to target in your python code, you need to first inspect the web page.

    To gather data from companies, you can inspect the page by right clicking on the element of interest and select inspect. This brings up the HTML code where we can see the element that each field is contained within.

    Right click on the element you are interested in and select ‘Inspect’, this brings up the html elements

    Since the data is stored in a table, it will be straight forward to scrape with just a few lines of code. This is a good example and a good place to start if you want to familiarise yourself with scraping websites, but keep in mind that it will not always be so simple!

    All 100 results are contained within rows in <tr> elements and these are all visible on one page. This will not always be the case and when results span over many pages you may need to either change the number of results displayed on a webpage, or loop over all pages to gather all the information.

    On the League Table webpage, a table containing 100 results is displayed. When inspecting the page it is easy to see a pattern in the html. The results are contained in rows within the table:

    <table class="tableSorter">

    The repeated rows <tr> will keep our code minimal by using a loop within python to find the data and to write a file!

    Entri gives you the best Coding experience

    🚀 Start Coding Today! Enroll Now with Easy EMI Options. 💳✨

    Gain expertise in Django and open doors to lucrative opportunities in web development.

    Start Learning With EMI Payment Options

    Parse the webpage html using Beautiful Soup

    Now that you have looked at the structure of the html and familiarised yourself with what you are scraping, it’s time to get started with python!

    The first step is to import the libraries that you will be using for your web scraper. We have already talked about BeautifulSoup above, which helps us to handle the html. The next library we are importing is urllib which makes the connection to the webpage. Finally, we will be writing the output to a csv so we also need to import the csv library. As an alternative, the json library could be used here instead.

    # import libraries
    from bs4 import BeautifulSoup
    import urllib.request
    import csv

    The next step is to define the url that you are scraping. As discussed in the previous section, this webpage presents all results on one page so the full url as in the address bar is given here.

    # specify the url
    urlpage =  'http://www.fasttrack.co.uk/league-tables/tech-track-100/league-table/'

    We then make the connection to the webpage and we can parse the html using BeautifulSoup, storing the object in the variable ‘soup’.

    # query the website and return the html to the variable 'page'
    page = urllib.request.urlopen(urlpage)
    # parse the html using beautiful soup and store in variable 'soup'
    soup = BeautifulSoup(page, 'html.parser')

    We can print the soup variable at this stage which should return the full parsed html of the webpage we have requested.

    print(soup)

    If there is an error or the variable is empty, then the request may not have been successful. You may wish to implement error handling at this point using the urllib.error module.

    Grab the opportunity to learn Python with Entri! Click Here

    Search for html elements

    As all of the results are contained within a table, we can search the soup object for the table using the find method. We can then find each row within the table using the find_all method.

    If we print the number of rows we should get a result of 101, the 100 rows plus the header.

    # find results within table
    table = soup.find('table', attrs={'class': 'tableSorter'})
    results = table.find_all('tr')
    print('Number of results', len(results))

    We can therefore loop over the results to gather the data.

    Printing the first 2 rows in the soup object, we can see that the structure of each row is:

    <tr>
    <th>Rank</th>
    <th>Company</th>
    <th class="">Location</th>
    <th class="no-word-wrap">Year end</th>
    <th class="" style="text-align:right;">Annual sales rise over 3 years</th>
    <th class="" style="text-align:right;">Latest sales £000s</th>
    <th class="" style="text-align:right;">Staff</th>
    <th class="">Comment</th>
    <!--                            <th>FYE</th>-->
    </tr>
    <tr>
    <td>1</td>
    <td><a href="http://www.fasttrack.co.uk/company_profile/wonderbly-3/"><span class="company-name">Wonderbly</span></a>Personalised children's books</td>
    <td>East London</td>
    <td>Apr-17</td>
    <td style="text-align:right;">294.27%</td>
    <td style="text-align:right;">*25,860</td>
    <td style="text-align:right;">80</td>
    <td>Has sold nearly 3m customisable children’s books in 200 countries</td>
    <!--                                            <td>Apr-17</td>-->
    </tr>

    There are 8 columns in the table containing: Rank, Company, Location, Year End, Annual Sales Rise, Latest Sales, Staff and Comments, all of which are interesting data that we can save.

    This structure is consistent throughout all rows on the webpage, and therefore we can again use the find_all method to assign each column to a variable that we can write to a csv or JSON by searching for the <td> element.

    Entri gives you the best Coding experience

    Looping through elements and saving variables

    In python, it is useful to append the results to a list to then write the data to a file. We should declare the list and set the headers of the csv before the loop with the following:

    # create and write headers to a list 
    rows = []
    rows.append(['Rank', 'Company Name', 'Webpage', 'Description', 'Location', 'Year end', 'Annual sales rise over 3 years', 'Sales £000s', 'Staff', 'Comments'])
    print(rows)

    This will print out the first row that we have added to the list containing the headers.

    You might notice that there are a few extra fields Webpage and Description which are not column names in the table, but if you take a closer look in the html from when we printed the soup variable above, the second row contains more than just the company name. We can use some further extraction to get this extra information.

    The next step is to loop over the results, process the data and append to rows which can be written to a csv.

    To find the results in the loop:

    # loop over results
    for result in results:
        # find all columns per result
        data = result.find_all('td')
        # check that columns have data 
        if len(data) == 0: 
            continue

    Since the first row in the table contains only the headers, we can skip this result, as shown above. It also does not contain any <td> elements so when searching for the element, nothing is returned. We can then check that only results containing data are processed by requiring the length of the data to be non-zero.

    We can then start to process the data and save to variables.

        # write columns to variables
        rank = data[0].getText()
        company = data[1].getText()
        location = data[2].getText()
        yearend = data[3].getText()
        salesrise = data[4].getText()
        sales = data[5].getText()
        staff = data[6].getText()
        comments = data[7].getText()

    The above simply gets the text from each of the columns and saves to variables. Some of this data however needs further cleaning to remove unwanted characters or extract further information.

    Grab the opportunity to learn Python with Entri! Click Here

    🚀 Start Coding Today! Enroll Now with Easy EMI Options. 💳✨

    Gain expertise in Django and open doors to lucrative opportunities in web development.

    Start Learning With EMI Payment Options

    Data Cleaning

    If we print out the variable company, the text not only contains the name of the company but also a description. If we then print out sales, it contains unwanted characters such as footnote symbols that would be useful to remove.

        print('Company is', company)
        # Company is WonderblyPersonalised children's books          
        print('Sales', sales)
        # Sales *25,860

    We would like to split company into the company name and the description which we can do in a few lines of code. Looking again at the html, for this column there is a <span> element that contains only the company name. There is also a link in this column to another page on the website that has more detailed information about the company. We will be using this a little later!

    Entri gives you the best Coding experience

    <td><a href="http://www.fasttrack.co.uk/company_profile/wonderbly-3/"><span class="company-name">Wonderbly</span></a>Personalised children's books</td>

    To separate company into two fields, we can use thefind method to save the <span> element and then use either strip or replace to remove the company name from the company variable, so that it leaves only the description.
    To remove the unwanted characters from sales, we can again usestrip and replace methods!

        # extract description from the name
        companyname = data[1].find('span', attrs={'class':'company-name'}).getText()    
        description = company.replace(companyname, '')
        
        # remove unwanted characters
        sales = sales.strip('*').strip('†').replace(',','')

    The last variable we would like to save is the company website. As discussed above, the second column contains a link to another page that has an overview of each company. Each company page has it’s own table, which most of the time contains the company website.

    Inspecting the element of the url on the company page

    Grab the opportunity to learn Python with Entri! Click Here

    To scrape the url from each table and save it as a variable, we need to use the same steps as above:

    • Find the element that has the url of the the company page on the fast track website
    • Make a request to each company page url
    • Parse the html using Beautifulsoup
    • Find the elements of interest

    Looking at a few of the company pages, as in the screenshot above, the urls are in last row in the table so we can search within the last row for the <a> element.

        # go to link and extract company website
        url = data[1].find('a').get('href')
        page = urllib.request.urlopen(url)
        # parse the html 
        soup = BeautifulSoup(page, 'html.parser')
        # find the last result in the table and get the link
        try:
            tableRow = soup.find('table').find_all('tr')[-1]
            webpage = tableRow.find('a').get('href')
        except:
            webpage = None

    There also may be cases where the company website is not displayed so we can use a try except condition, in case a url is not found.

    Once we have saved all of the data to variables, still within the loop, we can add each result to the list rows.

        # write each result to rows
        rows.append([rank, companyname, webpage, description, location, yearend, salesrise, sales, staff, comments])print(rows)

    Entri gives you the best Coding experience

    Writing to an output file

    You may want to save this data for analysis and this can be done very simply within python from our list.

    # Create csv and write rows to output file
    with open('techtrack100.csv','w', newline='') as f_output:
        csv_output = csv.writer(f_output)
        csv_output.writerows(rows)

    When running the python script your output file will be generated containing 100 rows of results that you can look at in further detail.

    Grab the opportunity to learn Python with Entri! Click Here

    Summary

    This brief tutorial on web scraping with python has outlined:

    • Connecting to a webpage
    • Parsing html using BeautifulSoup
    • Looping through the soup object to find elements
    • Performing some simple data cleaning
    • Writing data to a csv

    Python and Machine Learning Rectangle

    Share61SendShare

    Feeba Mahin

    Related Posts

    How to Create an SQL Developer Resume
    Articles

    How to Create an SQL Developer Resume

    May 14, 2025
    Why B.Ed/D.El.Ed Graduates Must Join Montessori TTC
    Articles

    Why B.Ed/D.El.Ed Graduates Must Join Montessori TTC

    May 14, 2025
    Opportunity and Scope of Yoga TTC
    Articles

    Opportunity and Scope of Yoga TTC

    May 14, 2025
    Next Post
    How to Catch All Exceptions in Python Programming

    How to Catch All Exceptions in Python Programming

    More to Explore

    1. Future of Python Developers
    2. Python Online Course with 100% Placement
    3. Steps To Code A Video Conferencing App Using Python
    4. Python Advanced Interview Questions and Answers
    5. Introduction to Data Visualization in Python
    6. Python developer – Skills, Courses, Job Roles
    7. Python Developer Salary in India
    8. Method Overloading in Python

    Practice Programs

    1. Program for Finding Factorial of a Number in Python
    2. Python Program to Convert Decimal to Binary Number
    3. Python Program for Fibonacci Series
    4. Prime Number Program in Python
    5. Python Program to Check Armstrong Number

    Python Training in Different Cities

    1. Python Training in Kochi
    2. Python Training in Trivandrum
    3. Python Training in Calicut

    Free Tutorials For You

    1. SQL Tutorial for Beginners PDF
    2. Python Tutorial for Beginners in Hindi
    3. GIT and GITHUB Tutorial for Beginners in Hindi
    4. HTML Exercises to Practice
    5. JavaScript Tutorial in Tamil
    6. DSA Practice Series
    7. Microsoft Excel Malayalam Tutorial
    8. Learn Bootstrap in Tamil
    9. Introduction to CSS in Malayalam
    10. Introduction to JavaScript in Malayalam
    11. Java Programming Notes PDF
    12. Introduction to HTML in Malayalam

    Courses

    • Data Science Course
    • Full Stack Developer Course
    • Software Testing Course
    • Data Science Course in Malayalam
    • Full Stack Developer Course in Malayalam
    • Full Stack Developer Course in Hindi
    • Full Stack Developer Course in Tamil
    • Full Stack Developer Course in Telugu
    • Full Stack Developer Course in Kannada
    • Python Programming Course
    • Practical Accounting Course
    • Structural Design Course
    • Quantity Surveying Course
    • Embedded Systems Course in Kerala
    • BIM Course
    • MEP Course
    • MEP QS Course
    • Stock Market Course
    • Stock Market Course in Malayalam
    • Stock Market Course in Tamil
    • Stock Market Course in Kannada
    • Forex Trading Course
    • Mutual Funds Course
    • PwC Edge : Strategic Accounting and Finance Programme
    • SAP FICO Training
    • SAP MM Training
    • SAP SD Training
    • ACCA Online Course
    • HR Management Course

    Company

    • Become a teacher
    • Login to Entri Web

    Spoken English Courses

    • Spoken English Course
    • Spoken English Course in Malayalam
    • Spoken English Course in Hindi
    • Spoken English Course in Tamil
    • Spoken English Course in Telugu
    • Spoken English Course in Kannada
    • Spoken English Course for Housewives
    • Spoken English Course for Working Professionals
    • Spoken English Course for School Students
    • Spoken English Course for College Students
    • Spoken English Course for Job Seekers
    • AI Powered Spoken English Course

    Quick Links

    • Explore Free Courses
    • Aptitude Questions
    • Articles
    • Videos
    • Entri Daily Quiz Practice
    • Current Affairs & GK
    • News Capsule – eBook
    • Preparation Tips
    • Kerala PSC Gold
    • Entri Skilling
    • Kerala PSC

    Other Courses

    • OET Coaching Classes
    • DHA Course
    • Nurse Recruitment Abroad
    • Montessori Teachers Training
    • Performance Marketing Course
    • German Language Course
    • Yoga Teacher Training Course
    • Digital Marketing Course
    • Options Trading Course
    • German Language A1 Course
    • German Language A2 Course
    • German Language B1 Course
    • German Language B2 Course
    • Diploma in Early Childhood Care and Education
    • Hospital and Healthcare Administration
    • Business Administration & Hospital Management
    • Hospital and Healthcare Administration

    Popular Exam

    • IBPS Exam
    • SBI Exam
    • Railway RRB Exam
    • Kerala PSC
    • Tamil Nadu PSC
    • Telangana PSC
    • Andhra Pradesh PSC
    • MPPSC
    • UPPSC
    • Karnataka PSC
    • Staff Selection Commission Exam
    • GATE

    © 2023 Entri.app - Privacy Policy | Terms of Service

    No Result
    View All Result
    • Kerala PSC
      • Kerala PSC General
        • Kerala PSC Exams
        • KAS Exam
        • Kerala PSC VEO Notification
        • Kerala Police SI
        • Kerala PSC LDC Notification
        • Kerala PSC Village Field Assistant Notification
        • Kerala PSC LD Typist Notification
        • Kerala PSC Food Safety Officer
        • Kerala PSC Excise Inspector Notification
        • Kerala PSC BDO Notification
        • Kerala PSC CPO Notification
        • Kerala PSC LGS Notification
        • Fire and Rescue Officer
        • Women Fire and Rescue Officer
      • Kerala PSC Teaching
        • Kerala PSC HSA
        • Kerala PSC HSST
        • KTET
        • LP/UP Assistant
        • KVS
        • Railway Teacher
      • Kerala PSC Technical
        • LSGD AE
        • Draftsman/Overseer
        • IEO
        • ATP
        • Polytechnic Lecturer
        • AE Electronics
        • Assistant Engineer
    • Banking
      • IBPS PO Notification
      • IBPS Clerk Notification
      • SBI PO Notification
      • SBI Clerk Notification
      • SBI SO Notification
      • SBI Apprentice Notification
      • Canara Bank PO Notification
      • Indian Bank PO Notification
      • RBI Assistant Notification
      • RBI Office Attendant Notification
      • IBPS RRB Notification
      • IBPS RRB Office Assistant Notification
    • Skilling
      • Coding
      • Spoken English
      • Stock Market
        • Share Market Today News
        • Share Market Analysis
      • Digital Marketing
      • Accounting Course
      • SAP
      • OET
      • German
      • IELTS
      • Quantity Survey
      • MEP
      • Structural Design
      • Montessori
      • Yoga Teaching
      • Oil and Gas
    • Courses
      • Data Science Course
        • Data Science Malayalam
        • Data Science Course in Tamil
        • Data Science Course in Telugu
        • Data Science Training in Kochi
        • Data Science Training in Trivandrum
        • Data Science Course in Calicut
        • Data Science Training in Thrissur
      • Data Analytics Course
        • Data Analytics Course in Malayalam
        • Data Analytics Course in Tamil
        • Data Analytics Course in Telugu
      • Technical Upskilling
        • Quantity Surveying Course
        • Structural Design Course
        • BIM Course in Kerala
        • MEP Course
        • Embedded System Course
        • MEP Quantity Surveying Course
        • MEP Course in Kochi
        • Quantity Surveyor Course in Tamil
        • Quantity Surveying Course in Telugu
        • Quantity Surveyor Course in Hyderabad
        • Quantity Surveying Course in Chennai
        • MEP Design Course in Kerala
        • HVAC Course
        • Steel Structure Design Course
        • RCC Design Course
      • Full Stack Developer Course
        • Full Stack Development Malayalam
        • Full Stack Development Hindi
        • Full Stack Development Tamil
        • Full Stack Development Telugu
        • Full Stack Development Kannada
      • Stock Market Course
        • Stock Market Course in Malayalam
        • Stock Market Course in Tamil
        • Stock Market Course in Kannada
        • Options Trading Course
      • Mutual Funds Course
      • Forex Trading Course
      • Spoken English Course
        • Spoken English Course in Malayalam
        • Spoken English Course in Hindi
        • Spoken English Course in Telugu
        • Spoken English Course in Tamil
        • Spoken English Course in Kannada
      • Python Programming Course
      • Software Testing Course
        • Software Testing Course in Malayalam
        • Software Testing Course in Tamil
        • Software Testing Course in Telugu
      • AWS Solutions Architect Associate Course
      • PwC Edge : Strategic Accounting and Finance Programme
      • Practical Accounting Course
        • Accounting Course in Malayalam
        • Accounting Course in Tamil
        • Tally Course
        • Taxation Course
        • UAE Accounting
        • GST Course
        • Zoho Books Training
        • GST Practitioner Course in Kerala
        • GCC VAT Course
      • ACCA Training Online
        • ACCA Course in Kerala
      • SAP Training Courses
        • SAP FICO Course
        • SAP MM Course
        • SAP SD Training
        • SAP FICO Course in Tamil
        • SAP MM Course in Tamil
      • HR Management Course
      • Performance Marketing Course
      • Mern Stack Developer Course
        • Full Stack Developer Course in Kochi
        • Full Stack Developer Course in Trivandrum
        • Full Stack Developer Course in Calicut
        • Full Stack Developer Course in Pune
        • Full Stack Developer Course in Bangalore
        • Full Stack Developer Course in Hyderabad
        • Full Stack Developer Course in Chennai
        • Full Stack Developer Course in Indore
        • Full Stack Developer Course in Jaipur
        • Full Stack Developer Course in Coimbatore
      • Digital Marketing Training
        • Digital Marketing Course in Kochi
        • Digital Marketing Course in Trivandrum
        • Digital Marketing Course in Calicut
        • Digital Marketing Course in Kollam
        • Digital Marketing Course in Thrissur
        • Digital Marketing Course in Kottayam
        • Digital Marketing Course in Kannur
      • Montessori Teacher Training
        • Montessori Teacher Training in Calicut
        • Montessori Teacher Training in Kochi, Ernakulam
        • Montessori Teacher Training in Trivandrum
        • Montessori Teacher Training in Kollam
        • Montessori Teacher Training in Malayalam
        • Montessori Teacher Training in Kannada
      • Other Courses
        • German Language Course
        • OET Coaching
        • DHA Course
        • MOH Exam Coaching
        • Nurses Recruitment Abroad
        • FMGE Coaching
        • ChatGPT Course
        • Forex Trading Course
        • Yoga Teacher Training Course
        • Diploma in Early Childhood Care and Education
        • Business Administration & Hospital Management Course
        • Hospital and Healthcare Administration
        • AI for Teachers Course
    • Others
      • Railway
        • RRB Technician Notification
        • RRB JE Notification
        • RRB ALP Notification
        • RRB NTPC Notification
        • RRB RPF Notification
        • RRB RPF SI Notification
        • RRB RPF Constable Notification
        • RRB Group D Notification
        • RRB RPSF SI Notification
        • RRB SSE Notification
      • SSC
        • SSC CPO Notification
        • SSC MTS Notification
        • SSC CGL Notification
        • SSC CHSL Notification
        • SSC GD Constable Notification
        • SSC Stenographer Notification
        • SSC JE Notification
        • SSC CAPF Notification
        • SSC JHT Notification
        • Delhi Police Constable Notification
        • Delhi Police SI Notification
      • GATE
      • MAT
      • KMAT
        • KMAT Kerala 2024
      • TET
        • APTET
        • CTET
        • DSSSB
        • Karnataka TET
        • Kerala TET
        • KVS
        • MPTET
        • SUPER TET
        • TNTET
        • TSTET
        • UPTET
      • UPSC
        • UPSC CAPF Notification
        • UPSC CDS Notification
        • UPSC NDA Notification
        • UPSC Civil service Notification
    • Free Learn
      • Free Courses
        • Free Coding Courses
        • Free Accounting Courses
        • Free Digital Marketing Courses
        • Engineering Upskilling Courses
        • Free Hospital Administration Courses
        • Free OET Training
        • Free SAP Courses
        • Free Teachers Training Courses
        • Free Trading Courses
      • Question Answer
      • Aptitude Questions
      • Webinars
    • Test Prep
      • Kerala PSC Coaching
        • KPSC Degree Level Exam Preparation
        • Kerala PSC 12th Level Exam Preparation
        • Kerala PSC 10th Level Exam Preparation
        • KAS Coaching
        • Kerala PSC LDC Coaching
        • Kerala PSC LD Typist Coaching
        • Kerala PSC Fireman Coaching
        • KSFE Assistant Exam Preparation
        • Secretariat Office Attendant Coaching
        • Secretariat Assistant Coaching
        • Kerala PSC SI Exam Coaching
        • Khadi Board LDC Exam Preparation
        • Devaswom Board LDC Coaching
        • University LGS Exam Preparation
        • University Assistant Exam Coaching
        • KPSC Scientific Officer Exam Coaching
        • KPSC Probation Officer Grade II
        • KPSC Food Safety Officer Coaching
        • KWA Sanitary Chemist Coaching
        • KPSC Diary Farm Instructor Exam Coaching
        • Kerala PSC KWA Lab Assistant Exam Coaching
        • Kerala PSC ICDS Supervisor Exam Coaching
        • KPSC Finger Print Searcher Coaching
        • Kerala PSC Welfare Officer Gr. II Exam Coaching
        • KPSC Assistant Dental Surgeon Coaching
      • KPSC Teaching Exams
        • HSA Exam Preparation
        • KPSC HSA Social Science Coaching
        • KPSC HSA Physical Science Coaching
        • KPSC HSA English Coaching
        • KPSC Junior Language Teacher Hindi
        • KTET Coaching
        • SET Coaching
        • LP/UP Assistant Exam Coaching
        • HSST Exam Preparation
        • HSST Commerce Exam Coaching
        • Kerala PSC Lecturer in Diet Coaching
        • KVS PGT/TGT Coaching
      • Kerala PSC Technical Exams Coaching
        • Assistant Engineer Electrical Exam Coaching
        • Assistant Engineer Electronics Coaching
        • Assistant Engineer Mechanical Coaching
        • Kerala PSC Industries Extension Officer Coaching
        • KPSC LSGD AE Exam Coaching
        • KPSC Civil Engineering Exam Coaching
        • KPSC Mechanical Engineering Exam Coaching
        • KPSC Electrical Engineering Exam Coaching
        • KPSC Electronics Engineering Exam Coaching
        • KPSC Technical Computer Science Coaching
        • KPSC Tradesman Turning Coaching
        • Kerala PSC Overseer Exam Coaching
        • KPSC Assistant Town Planner Coaching
        • Lecturer in Polytechnic Electronics Coaching
      • Teaching Exams Coaching
        • CSIR NET Exam Coaching
        • EMRS Coaching
        • CTET Exam Online Coaching
      • IELTS Training Online
      • Bank Exam Coaching Online
        • SEBI Grade A Coaching
        • IBPS SO Online Coaching
        • IBPSC PO Online Coaching
        • IBPSC Clerk Online Coaching
        • SBI PO Coaching
        • SBI Clerk Online Coaching
        • SBI Apprentice Class
        • SBI SO Online Coaching
        • RBI Grade B Coaching
        • RBI Assistant Coaching
        • CSEB Exam Coaching
        • IBPS RRB Coaching
        • IBPS RRB PO Coaching
        • Canara Bank Po Exam Coaching
        • Kerala Gramin Bank Coaching
        • Kerala Bank Exam Coaching
        • JCI Exam Coaching
        • NABARD Grade A Coaching
        • LIC AAO Coaching Online
      • UPSC Online Coaching
        • UPSC CAPF Online Coaching
      • SSC Online Coaching
        • SSC JE Online Coaching
        • SSC CGL Coaching
        • SSC CGL AAO Coaching
        • SSC CGL CBI Inspector Coaching
        • SSC CHSL Coaching
        • SSC MTS Coaching
        • SSC Stenographer Coaching
        • SSC GD Online Coaching
      • RRB Exams Coaching
        • RRB RPF Exam Coaching
        • RRB NTPC Exam Coaching
        • RRB JE Online Coaching
        • RRB JE Electronics Coaching
        • RRB ALP Exam Coaching
        • RRB Technician Exam Coaching
      • CAT Online Coaching
      • CMAT Online Coaching
      • XAT Exam Coaching
      • GATE Online Coaching
        • GATE CE Online Coaching
        • GATE ME Online Coaching
        • GATE EE Online Coaching
      • NMAT Exam Coaching
      • AAI ATC Jr Executive Coaching
      • Cochin Shipyard Executive Trainee Coaching
      • BEL Probationary Engineer Coaching
      • HPCL Junior Executive Coaching

    © 2023 Entri.app - Privacy Policy | Terms of Service

    Chat