Retrieving valuable information from webpages using VBA

Clicking on the "Export to Excel" button in this link will initiate a download of an Excel sheet containing detailed information about a specific stock.

In my Excel VBA project, I need to automate the process of downloading this excel file. My code loops through a set of links, downloads books from each one, and copies and pastes certain data. However, I realized that for web downloads, the link must end with xlsx, csv, or something else related to Excel.

Sub transfercsv()
sLink = "http://www.screener.in/company/?q=500095" 'I can loop and attach links to this..
sfile = "downloaded.xls" 'I can get this rectified as well...
ssheet = "Data sheet" 
'Further code I can build up
....
End sub

My ultimate question: "How can I instruct Excel VBA to automatically download the workbook connected to the Export to Excel link?"

Alternatively,

"How can I locate the xlsx link associated with the Export to Excel button?"

P.S:- I have also tagged this as JSON because during my research, I discovered that the export link may be related to JSON.

Answer №1

Hello, this is a message from Pratyush at Screener.in.

Unfortunately, the method mentioned above will not be effective due to several technical limitations:

  1. The export function relies on a POST request.
  2. The page can only be accessed after logging in as a user.
  3. To prevent automated actions, there is CSRF protection implemented for the post request.

This has been put in place because generating personalized XLSX files requires significant server resources, and since we are on a shared hosting platform, our resources are limited.

A much better option would be to utilize Google Docs worksheets. They have an excellent API that is integrated with Google Finance, which provides extensive financial data.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Exploring the contrast in Python Requests package's treatment of data and json parameters

What distinguishes the data from the json parameters in Python's Requests library? The documentation available at this link does not provide a clear answer. Consider this code snippet: import requests import json d = {'a': 1} response = re ...

Is there a way to retrieve queried values and store them in an object to pass them to another script?

I'm struggling to consolidate the results of several queries into a single object and then return it to my main script for display. My grasp on OOP principles is not very strong, but it appears that I may be inadvertently nesting objects within one an ...

encountering the error "Could not find a corresponding intent handler for: null" when trying to access a webhook URL

I have been facing an issue with calling a webhook from Dialogflow. I am not receiving any response from the webhook, and instead, I am getting the response from the intent section that I have configured. I have made sure to enable the webhook for each int ...

Is the URL endpoint for the moviedb not functioning properly?

While working on my android movie app that utilizes themoviedb, I encountered an error when trying to access the movies json endpoint. The error message received from postman was as follows: { "status_code": 7, "status_message": "Invalid API key: Y ...

Is it possible to include an if or else condition in jQuery JSON response?

I have an issue with adding my Jquery JSON response to a data table. However, I need to implement if conditions based on the day. Can you provide me with an example of how to do this? Specifically, I need to use conditions in the data.hours.day field. Th ...

I am facing an issue where I am unable to view JSON objects despite utilizing json2html library

Currently, I am facing a minor problem while trying to incorporate json2html into a project. Despite running the transform function successfully, it is not including the JSON objects as expected. In my setup, I execute a call to MongoDB, retrieving the JS ...

Utilizing Selenium Builder tests in combination with Jenkins and GitHub

My objective: Establishing a streamlined test framework utilizing Selenium Builder as a Firefox plugin, GitHub, and Jenkins. Storing the test files in .json format is essential for my workflow. At this point, I prefer to stay away from Java and Maven. My ...

Exploring the wonders of jquery's JSON parsing capabilities

Having trouble parsing the JSON data that is out of my control. Can anyone help me figure out what I'm doing wrong here? data.json { "img": "img1.jpg", "img": "img2.jpg", "size": [52, 97] } { "img": "img3.jpg", "img": "img4.jpg", "size ...

Send a request to the XML file through the web

I am currently working with a vendor who has provided me with information that I need to code in order to retrieve data from them. The task at hand is sending a POST request to a URL that ends with .xml. The documentation specifies that the request shoul ...

Querying a JSON field in BigQuery yields empty results

Once more, I am struggling with my SQL query on a JSON field in bigquery. This JSON data can be found at this link - The specific record I am working with has an id of 1675816490 Here is the SQL statement I am using: SELECT ##JSON_EXTRACT(jso ...

Attempting to manipulate arrays by using the json_query method

I'm experiencing difficulties with using the json_query function to filter arrays based on a specific key value. When providing the direct path, this is the API result that is displayed: ok: [localhost] => { "msg": [ { ...

Is it considered acceptable to perform roughly 100 queries on the Android SQLite database for the purpose of storing a single data item?

I have recently incorporated SQLite data storage into my Android translator app. The current situation is as follows: the app receives translations in JSON format from a server, then proceeds to parse it and build an object tree consisting of 50 to 100 obj ...

Code for dividing large JSON data based on node names in a generic way

I am facing a challenge with handling very large JSON files, where the car array can contain up to 100,000,000 records. The file size ranges from 500mb to 10 GB and I am currently using Newtonsoft json.net for processing. Input { "name": "John", "age": " ...

The jQuery autocomplete feature presents all choices regardless of what is typed into the input field

I'm currently working on a jQuery script that retrieves a JSON response and creates individual "player" objects based on the data received. These player objects are then added to the availablePlayers array, which serves as the data source for the aut ...

Jackson encountered difficulty in the conversion of JSON to a list of maps

In my spring-boot application, I have a controller that looks like this: @RequestMapping(path = { "/multiCommunication" }, consumes = { MediaType.APPLICATION_JSON_VALUE }, method = RequestMethod.POST) ResponseEntity<Object> multiCommunicatio ...

How to designate the specific container to be updated in the XMLHTTP JSON code within a Joomla website?

Below are some functions that were created by a former developer who is no longer with the company. These functions query a database and return JSON code to update the inner HTML of a specific div. I have now been tasked with setting up a typeahead search ...

Why do I keep receiving the unprocessed JSON object instead of the expected partial view output?

Upon submitting my form, instead of displaying the testing alerts I have set up, the page is redirected to a new window where the raw JSON object is shown. My assumption is that this occurrence is related to returning a JSON result from the controller. How ...

Is there a way to bypass strict JSON parsing when using jQuery's .ajax() function?

From jQuery 1.9 onwards, when using dataType: json in a .ajax call and the response body cannot be parsed as JSON, the request will fail silently: The parsing of JSON data is strict; any malformed JSON will be rejected with a parse error. Starting from ...

Tips for verifying elements using the Loop technique in a JSON array

I am new to JavaScript and I have been trying to run the following code with an expected result like this: [["00:04:12","05:54:46"],["06:06:42","12:45:22"],["12:51:11","15:56:11"]] However, my script is not working as expected. Can someone please help ...

How to convert Firebase snapshot JSON data to text format instead of an object in Vue.js

After successfully pulling the data, it shows up as an object in my view: { "-MH8EpUbn1Eu3LdT0Tj0": { "code": "https://www.apesyntax.com", "content": "This is the tut content", "date": "2020- ...