Enter data in to a website form

General FreeBASIC programming questions.
Post Reply
Troodos
Posts: 3
Joined: Mar 30, 2022 15:46

Enter data in to a website form

Post by Troodos »

How may I enter data in to a website and then wait for the new page with data to load and read it in?

I can process the data I want to grab using FB just fine - the problem is getting the data.

The website I need to enter data at is: https://heliumnet.info/poc.php

Once I have done this and issued the 'send' another page of data will eventually load that I need to read in. Any pointers or examples to help me would be greatly appreciated - have been searching the forum for a while and can't identify what I need.
Imortis
Moderator
Posts: 1925
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: Enter data in to a website form

Post by Imortis »

Moved to General.
Lost Zergling
Posts: 538
Joined: Dec 02, 2011 22:51
Location: France

Re: Enter data in to a website form

Post by Lost Zergling »

Consider using an existing tool (actionaz) you launch by shell, then use FB, Perl, or whatever as backend.
Adv : simple, no need crazy development, easy to operate, powerfull.
Cons : front end automation to maintain, heterogenous software system, build in third party solution.
Troodos
Posts: 3
Joined: Mar 30, 2022 15:46

Re: Enter data in to a website form

Post by Troodos »

Thank you for the suggestion - the ideal solution needs to be a single solution as I would like to distribute the executable for others to use - when I search for advice on the forum for reading from websites various libraries are mentions, which is confusing as I have no idea which one may be relevant, and I can't find any info on how to interact with websites, there must be a solution? Perhaps to do this I need to defect to some other Basic programming solution that supports it more easily?
Lost Zergling
Posts: 538
Joined: Dec 02, 2011 22:51
Location: France

Re: Enter data in to a website form

Post by Lost Zergling »

Will your solution require use of front-end triggers or not ?
If so, you should consider rewriting something light and custom from scratch, in the taste of 'actionaz', I do not know which or if any FB library would be adapted for that purpose, perhaps requiring windows or system programming, interrupting mouse driver and so on.
If not, you may encounter some serious troubles, trying to emulate some parts of a navigator, wich sounds complex if only at website security level.
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Enter data in to a website form

Post by srvaldez »

adeyblue
Posts: 300
Joined: Nov 07, 2019 20:08

Re: Enter data in to a website form

Post by adeyblue »

I don't know what valid entries to those fields are (so I can't be sure), but it looks like you can just request the data from this url

Code: Select all

https://heliumnet.info/poc_result.php?hs=myhotspot&in=2012-12-12T09:08:12&out=2012-12-12T12:22:32
hs=<hotspot address field>
in=YYYY-MM-DDTHH:MM:SS (start date)
out=YYYY-MM-DDTHH:MM:SS (end date)

You'll need to urlencode the hs field value but then smush them all together with an & in between and add them on the url like the format above.

Bear in mind, if you don't have permission then scraping endpoints like this is generally not considered friendly. Someone has to pay for it to be online and if 100's of people start trying to dump their entire database one request at a time, and they're not expecting it, then in the worst case scenario, there may not be an endpoint to scrape for much longer.
Troodos
Posts: 3
Joined: Mar 30, 2022 15:46

Re: Enter data in to a website form

Post by Troodos »

Yes, of course, I should have realised this - thank you for pointing out the simple solution, essentially is it passed similarly to a command line.

Totally get the point about multiple queries, but I think this is fairly niche, so it won't be attracting 100's or even 10's of concurrent users - I am in contact with the website owner and he is ok with it ;)
Post Reply