Python Forum
Is this possible to write a script for checking data from website?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is this possible to write a script for checking data from website?
#1
I am doing some data checking about name, mmsi and length of the ships. ( https://www.marinetraffic.com/en/ais/hom...2.5/zoom:6 ) I need to check whether the data I got is match with this website. The data is excel table format. I am new in python. I am not sure whether it is achievable with the use of python. And what statement I need to know to achieve it ?
Thank you.
Reply
#2
You can get data from webpages, web-scraping, with

import requests
from bs4 import BeautifulSoup
Read up on those! When you have mastered that, you can specifically get the information you require.

url = 'https://www.somedotcom.com/awebpage.html'
res = requests.get(url)
html_page = res.content
soup = BeautifulSoup(html_page, 'html.parser')
text = soup.find_all(text=True)
You can narrow down the search by only getting text contained in certain html tags.
Then, you can compare what you got with what is in your Excel.

To open Excel in Python, read up on openpyxl a Python module for handling Excel files.

Then, if you have a specific problem, you can ask the experts here, they (not like me) really know a lot about these things!
Reply
#3
I suggest tutorial here from snippsat (short and to the point):
Web-Scraping part-1
Web-Scraping part-2
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  how to write/overwrite data in a txt. file according to inp Quinn 2 1,587 Aug-12-2025, 04:20 PM
Last Post: Quinn
  Write json data to csv Olive 6 2,436 Oct-22-2024, 06:59 AM
Last Post: Olive
  Scraping Data from Website melkaray 3 2,472 Sep-22-2023, 12:41 PM
Last Post: melkaray
  Write sql data or CSV Data into parquet file mg24 2 5,420 Sep-26-2022, 08:21 AM
Last Post: ibreeden
  Code to retrieve data from a website charlie13255 0 2,320 Jul-07-2022, 07:53 PM
Last Post: charlie13255
  Write and read back data Aggie64 6 4,160 Apr-18-2022, 03:23 PM
Last Post: bowlofred
  Is it possible to write a python script to block twitter feeds? cubangt 0 1,875 Apr-07-2022, 04:14 PM
Last Post: cubangt
  Architecture question for website with python crontab script rockie12us 1 2,874 Aug-09-2021, 10:07 AM
Last Post: Larz60+
Lightbulb [Solved] df.loc: write data in certain rows ju21878436312 1 2,898 Jun-28-2021, 06:49 AM
Last Post: ju21878436312
  Extracting data from a website tgottsc1 2 3,574 Jan-09-2021, 08:14 PM
Last Post: tgottsc1

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020