4
I would like to make an HTTP request to my college server by mimicking the requests sent by the browser so I can log in and check my notes.
I already have experience with mobile development, my intention is in the future to develop an App for access notes, absences, college courses.
How can I make these requests on Node.js?
Guy checks if they have an API for programmers to use (usually not have), or tries to use CURL, take a look at this tutorial
– Jonatan Ribeiro dos Santos
@Jonatanribeirodossantos , this really seems to be what I look for, however I have no knowledge of php. to run a php I need to have a server running locally ?
– user3896400
Friend what language you’re using?
– Guilherme Nascimento
I know very well python and javascript...
– user3896400
If you want to use java, look for the class
java.net.HttpURLConnection
.– Victor Stafusa
Dude, if your javascript skills try to do in nodejs, or if you know Python take a look at how to use CURL in python, it shouldn’t be the end of the world.
– Jonatan Ribeiro dos Santos
Python URL does not exist in windows 64 bits
– user3896400
Hello, welcome to [en.so]! I made a small edition in the question to try to make it clearer. However, it would be better to specify in which language or platform. I tagged
android
Just because you said you have some experience in mobile programming. But please edit your question by specifying better with which technology you want to make the requests. Hug!– utluiz
Python you can use mechanize, for example...
– Felipe Avelar
I saw that the tag was changed to
javascript
. If you want to make a script to run in the browser it will most likely not be possible to make HTTP requests to your college server, as the standard security policy prevents Ajax requests between different domains. It would be possible to do this with Node.js, but then it would involve all the environment configuration. Maybe it’s better to stay with Python. But, if you want to do this in the future on Android, my suggestion is already do it in Java to facilitate.– utluiz
I agree with what @utluiz said (except with the part that doing Java is easier than Node.js + Javascript, hehehehe).
– bfavaretto
A friend advised me to use Node js, since what I want to do is like a Mining data, because I am trying to receive information from a server without the browser... I think I will try to use Node, if anyone has any advice I thank you.
– user3896400
So, the Node fits perfectly for this, does not run in the browser. You can even use a browser headless (no graphical interface) like phantomjs, so you can mine data even from ajax-based websites (which you wouldn’t normally be able to).
– bfavaretto
@bfavaretto Not that Java is easier. It’s easier to pass a Java code to Android just because it’s Java too (or almost that). ;)
– utluiz
Ah, I didn’t realize I had Android in play. In this case he will have to swallow Java even (hehehe x 2). @utluiz
– bfavaretto
Can be done with Zombiejs which is a framework for testing web pages simulating a browser and Node has Phonegap which creates HTML5+CSS+JS-based hybrid applications for the case you want for mobile app
– Caputo