How to Scrape Website Usage/User Data for a Website that Does Not Have an API

I am an aspiring Data Analyst and I was wondering how do I web scrape website usage/user data such as:

  • total people who visited that website,
  • total visitors per page,
  • how long did each visitor stay on each page, etc.

The website I am interested in scraping does not have an API in case that effects your answer. I have searched online, watched many YouTube tutorials, etc., but it doesn't pertain to the data I need.

I don't know the terminology (the words) I would use to get the usage data above. I don't know where this sort of data lives on websites and if it's even accessible to the general public?

I have used the code below in Python using BeautifulSoup and urllib.request but I don't know if this is the right way to go about getting the usage/user data in particular because it's not the the typical data that I have typically scraped like:

print('title, nav, href, etc...')

Below is the code I use when I am scraping data for things like: title, nav, href, etc.

import bs4 as bs 
import urllib.request 

source = urllib.request.urlopen(“the website you are scraping”).read()

soup = bs.BeautifulSoup(source, ‘lxml’)

print(soup) 

Any and all help would be greatly appreciated.

Thank you.

Topic web-scraping data-science-model data python

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.