Wget/curl and javascript


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Wget/curl and javascript

What can I use instead of wget/curl when I need to log into websites that use javascript?


Wget and curl don't handle javascript.
# 2  
Your question makes no sense.

The web uses HTTP as a universal protocol for client-server web transactions.

The server and the client are independent objects/ entities that can exchange data because of HTTP. Javascript or not, curl or not, wget or not? These topics are an independent and mostly unrelated issue.

That is why there are communication protocols, to decouple the application and underlying programming language from the client-server comms. In this case:

Hypertext Transfer Protoco (HTTP)

So, it should not matter if talking "shoestring" to "elephant ear" as long as both the client and the server adhere to the same HTTP protocol standard(s).

Anyway, underlying most Javascript implements like node.js (on the server side) is C++ and the same is true of wget, curl, etc. At the core of most of all this is C++ (not that it matters).

Regardless of the programming language, HTTP-based client-server applications can communicate (exchange data) because they follow the same set of communication protocol standards.
# 3  
Wget and curl sometimes don't show the same content as web browsers. The parts generated by javascript don't seem to be included in wget and curl.
# 4  
You reply has little to do with your original statement:

Quote:
Wget and curl don't handle javascript.
I have no idea (without a wild guess on my part) what that means. Please be precise when talking tech Smilie

I work with server-side data every day and I have not used wget or curl to pull any web site date for a web application in over 6 years, maybe longer.

All modern day web developers use Javascript libs to pull data from the web when building a web app.

Of course, we all occasionally use wget and curl to do simple tasks like pull a single file from a web site; or some other very simple function. But in general, that is also rapidly becoming obsolete as most web developers use GitHub for their repos and use git to store and push the data.

And of course, some people still use wget and curl - like tools when they want to spider another web site and try to pull it's data (often without the website's owners permission).

It would help if you would explain what you are trying to do.

Are you are trying to "spider" or "content scrape" web sites?

It does not sound like you are building a web app.

What are you doing, really?
# 5  
I'm creating login, download and upload scripts for different websites, and have become curious during the process.


I'm not in conflict with anyone's permission.
# 6  
To some extent you can work around javascript things by reverse-engineering the javascript and figuring out what webpage data is actually being sent where. Essentially you're working out the 'protocol' so you can throw away the javascript and do it yourself. This is tedious and fraught.

If you want to actually execute javascript natively, you will need a web browser. links2 is a browser with console mode that still has a javascript interpreter, but automating it doesn't seem any easier than any other browser.

Last edited by Corona688; 03-25-2019 at 01:23 PM.. Reason: typo
# 7  
Quote:
Originally Posted by locoroco
I'm creating login, download and upload scripts for different websites, and have become curious during the process.


I'm not in conflict with anyone's permission.
If you want to process Javascript outside of the browser you can use node.js and other V8 engines.

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.

Quote:
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.
Quote:
.... the Ecma Standard defines the ECMAScript 2020 Language. It is the tenth edition of the ECMAScript Language Specification. Since publication of the first edition in 1997, ECMAScript has grown to be one of the world's most widely used general-purpose programming languages. It is best known as the language embedded in web browsers but has also been widely adopted for server and embedded applications.
See also, as a reference on how to "screen scrape" with Javascript and render Javascript:

The Ultimate Guide to Web Scraping with Node.js

You can research, modify and adapt these ideas as you see fit for your web app.
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Wget vs Curl - Proxy issue
sathyaonnuix
Hi, My script needs to crawl the data from a third party site. Currently it is written in wget. The third party site is of shared interface with different IP addresses. My wget works with all the IP address but not with one. Whereas the curl is able to hit that IP address and comes out...... Shell Programming and Scripting
2
Shell Programming and Scripting
Encapsulating output of CURL and/or WGET
SkySmart
i use curl and wget quite often. i set up alarms on their output. for instance, i would run a "wget" on a url and then search for certain strings within the output given by the "wget". the problem is, i cant get the entire output or response of my wget/curl command to show up correctly in...... Shell Programming and Scripting
3
Shell Programming and Scripting
How to download file without curl and wget
rubber08
Hi I need a Shell script that will download a zip file every second from a http server but i can't use neither curl nor wget. Can anyone will help me go about this task ??? Thanks!!... Shell Programming and Scripting
1
Shell Programming and Scripting
Specifying IP address with curl/wget
colinireland
Hello, I am wondering does anyone know of a method using curl/wget or other where by I could specify the IP address of the server I wish to query for a website. Something similar to editing /etc/hosts but that can be done directly from the command line. I have looked through the man pages...... Shell Programming and Scripting
4
Shell Programming and Scripting
Proxy with curl/wget support
locoroco
I need a proxy that would enable me to use cli curl/wget with another ip address. How do I find a paid proxy server that supports curl/wget?... Shell Programming and Scripting
1
Shell Programming and Scripting