jas_ananth Posted June 12, 2020 Posted June 12, 2020 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
jas_ananth Posted June 12, 2020 Author Posted June 12, 2020 @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 ?
Developers Jos Posted June 12, 2020 Developers Posted June 12, 2020 29 minutes ago, jas_ananth said: Can you please help ? So...post your current code and tell us what isn't working that you don't understand! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Guest Posted June 12, 2020 Posted June 12, 2020 (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 June 12, 2020 by Musashi
jas_ananth Posted June 13, 2020 Author Posted June 13, 2020 #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 Melba23 Posted June 13, 2020 Moderators Posted June 13, 2020 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 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now