Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

How to save data from webpage visit?

I have a tool on my webpage that displays the users ip address when they visit (this displays as json on the page)

but, how to save that data so that I can view it later?

the website is hosted on flask/python

so I guess i need a basic script/task that will save the data on file somewhere - how? thanks
You're talking about access logging and analytical statistics, I suppose. Google Analytics is good at analytical statistics and you might want to look into your server logs and how you can use those to track activity:

https://flask.palletsprojects.com/en/1.1.x/logging/

You can later analyse those access logs and write a tool to display them visually on your administrative panel.
[Image: vp6iypF.gif]
I can get the ip address already, with a python snippet inserted into the page code

when I access my own page, I can see my ip address, but I want to see other peoples' visits - ie. save the ip address that shows on the screen

can this be done with a simple 'always on task' or some kind of scraping?

Google analytics doesn't show the ip addresses
(Oct 23, 2019 09:19 PM)Red-Leonard Wrote:  I can get the ip address already, with a pyhton snippet inserted into the page code

when I access my own page, I can see my ip address, but I want to see other peoples' visits - ie. save the ip address that shows on the screen

can this be done with a simple 'always on task' or some kind of scraping?

Google analytics doesn't show the ip addresses

I really don't understand what you mean by that. I already told you about access logs and how you can essentially write their IP addresses in those logs? Am I missing something here? You do know what an access log is, right?

Code
app.logger.info('%s logged in successfully', user.ip) # This is an example
https://flask.palletsprojects.com/en/1.1.x/logging/
[Image: vp6iypF.gif]
I've looked at access logs, and no ip details in there

my bad, you are right


I've found the access logs!

I was mistakenly looking in the 'server logs'

thanks all the same!


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by Johan CruyffOct 20, 2018 01:45 PM 1 185 Oct 20, 2018 01:45 PM
Last Post: CreatedAutomated
[.NET] by Phoenix_101VB.NET_DUDENov 19, 2016 04:14 PM 13 473 Nov 19, 2016 04:14 PM
Last Post: Ninja
[.NET] by Mr FoxJul 27, 2015 10:40 AM 12 327 Jul 27, 2015 10:40 AM
Last Post: +Haze