Jump to content

Recommended Posts

Posted

Hi, 

I am trying to Search/Scrape web page for certain data in the website. New to AutoIt, While debugging i understood the $sHTML is coming null. So could not proceed. 

If i change the Source URL to some other website, i could see $sHTML variable having values. Can some one shed some light, on whats happening ? Below is the code i am referring..

#include <Inet.au3>
#include <Array.au3>
#include <String.au3>

Local $sHTML   = _INetGetSource("https://www1.nseindia.com/live_market/dynaContent/live_watch/get_quote/GetQuoteFO.jsp?underlying=NIFTY&instrument=FUTIDX&type=-&strike=-&expiry=25JUN2020")
Local $aResult = _StringBetween($sHTML, "Selected Candidate : ", "<span id=""status1"">")
If Not @error Then
    _ArrayDisplay($aResult)
Else
    ConsoleWrite('! No strings found.' & @CRLF)
EndIf

Posted (edited)
4 hours ago, jas_ananth said:

@Musashi i picked your code from "https://www.autoitscript.com/forum/topic/200610-how-to-get-text-from-webpage/" and just changed the URL to something which i need, Can you please help ?

Does

#include <Inet.au3>

Local $sHTML = _INetGetSource("https://www1.nseindia.com/live_market/dynaContent/live_watch/get_quote/GetQuoteFO.jsp?underlying=NIFTY&instrument=FUTIDX&type=-&strike=-&expiry=25JUN2020")
If Not @error Then
    ConsoleWrite($sHTML & @CRLF)
Else
    ConsoleWrite('! No strings found.' & @CRLF)
EndIf

or even "https://www1.nseindia.com/" return any results ?

I entered your link in a sandboxed Firefox browser, but did not get a connection.

EDIT : Depending on the technical structure of the particular website, the usage of the awesome webdriver-udf-w3c-compliant-version-05252020 from @Danp2 may be required.

Edited by Musashi
Posted
#include <Inet.au3>

Local $sHTML = _INetGetSource("https://www1.nseindia.com/live_market/dynaContent/live_watch/get_quote/GetQuoteFO.jsp?underlying=NIFTY&instrument=FUTIDX&type=-&strike=-&expiry=25JUN2020")
If Not @error Then
    ConsoleWrite($sHTML & @CRLF)
Else
    ConsoleWrite('! No strings found.' & @CRLF)
EndIf

This code did not work.. @Jos

 @Musashi even  "https://www1.nseindia.com/" did not result any data..  i tried installing webdrivers... but still unsuccesful..

  • Moderators
Posted

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...