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
  Scraping Data from Website melkaray 3 789 Sep-22-2023, 12:41 PM
Last Post: melkaray
  script to calculate data in csv-files ledgreve 0 1,102 May-19-2023, 07:24 AM
Last Post: ledgreve
  Write sql data or CSV Data into parquet file mg24 2 2,431 Sep-26-2022, 08:21 AM
Last Post: ibreeden
  Code to retrieve data from a website charlie13255 0 983 Jul-07-2022, 07:53 PM
Last Post: charlie13255
  Write and read back data Aggie64 6 1,878 Apr-18-2022, 03:23 PM
Last Post: bowlofred
  Is it possible to write a python script to block twitter feeds? cubangt 0 870 Apr-07-2022, 04:14 PM
Last Post: cubangt
  Architecture question for website with python crontab script rockie12us 1 1,735 Aug-09-2021, 10:07 AM
Last Post: Larz60+
Lightbulb [Solved] df.loc: write data in certain rows ju21878436312 1 1,709 Jun-28-2021, 06:49 AM
Last Post: ju21878436312
  Extracting data from a website tgottsc1 2 2,271 Jan-09-2021, 08:14 PM
Last Post: tgottsc1
  Unable to Validate csv blanck data and write in csv prashant18 0 1,535 Jul-25-2020, 12:08 PM
Last Post: prashant18

Forum Jump:

User Panel Messages

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