Browser support

Started by hdsouza, March 06, 2020, 09:41:07 AM

Previous topic - Next topic

hdsouza

While IE has been the prominent browser for several years, support for it is waning.
I am also seeing companies build their sites with the least compatibility to IE (https://www.myconstant.com).
In fact Microsoft has come up with Edge and prodding clients to move away from IE to Edge.
That being said Winbatch only support IE for automation. Any ideas if Winbatch will support a different browser... Like Edge, Firefox or Chrome?
If work has already started, is there any timelines.

Thanks


td

This is very old news.  Based on what people that get paid to track these things report and our experience with our websites not that many Internet users browse with either IE or Edge.   

Also, it is not clear what exactly you mean by  "automation" but WinBatch does not directly support any specific browser.  WinBatch does, however, support COM Automation and .Net CLR hosting. Since MSFT made IE a COM Automation server, you can use WinBatch COM Automation to work with IE objects just like any other application or library that acts as a COM server.   MSFT also has COM Automation browser objects built into the Windows shell (including Windows 10) that can be used to access websites.  They are not going away anytime in the foreseeable future because too many of MSFT's own desktop systems need them. 

Other browsers may provide .Net access to their functionality directly or through third-party open-source add-on libraries. It is likely that you can use WinBatch CLR hosting to work browsers that provide that kind of direct or indirect support.

Of course, there is always direct access to websites using COM Automation object, dotNet assemblies, or WinBatch extenders if you don't need to worry about client-side javascript interpreting.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

hdsouza

So at the end of day will there be support for a different browser type?
By winbatch "extenders" do you mean the Win Inet Extender. I though that was specific to IE.

td

No, the WinInet extender is not "specific to IE."
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

hdsouza

Quote from: td on March 07, 2020, 07:17:22 AM
No, the WinInet extender is not "specific to IE."

Wininet only gets a few lines of code around the page.. but not the full page.
See:
Code (winbatch) Select

AddExtender("WWINT44I.DLL")
Count_HostConnect = 0
File_HostConnect = "c:\temp\File_HostConnect.txt"
Var_url = "https://www.myconstant.com/pro-lending"
GoSub HostConnect_Extract
exit

:HostConnect_Extract
Filedelete(File_HostConnect)
Page_Error = 0
URL_Temp = strreplace (Var_url, "https://", "")
URL_Temp = strreplace (URL_Temp, "http://", "")
Url_Main =  strtrim(Itemextract(1, URL_Temp, "/" ))
Url_Remain = strtrim(strreplace(URL_Temp, "%Url_Main%/", ""))

Exist_invalid = 0

tophandle=iBegin(0,"","")
connecthandle=iHostConnect(tophandle, Url_Main, @HTTP, "", "")
datahandle=iHttpInit(connecthandle, "GET", Url_Remain, "",0)
If datahandle==0 then
   err=iGetLastError()
   URL_Error = err_datahandle
   iClose(tophandle)
   Page_Error = 1
EndIf

rslt=iHttpOpen(datahandle, "", 0, 0)
If rslt=="ERROR" || rslt!=200 then
   URL_Error = rslt
   iClose(datahandle)
   iClose(connecthandle)
   iClose(tophandle)
   Page_Error = 1
EndIf

iReadData(datahandle, File_HostConnect)
iClose(datahandle)
iClose(connecthandle)
iClose(tophandle)

Return


The only way to get the whole page (which winbatch supports) is MSIE
See: https://forum.winbatch.com/index.php?topic=2356
...But this specific page (https://www.myconstant.com/pro-lending) does not work with IE, which is what I mentioned in my initial post.

Or if not, any other ways of extracting the "investing orders" on the page using winbatch, please let me know.

Thanks

td

Again, this is a field already plowed.  The topic of the WinInet extender not being a browser has been explained to you on multiple occasions. Browsers have functionality for decompressing compressed sites and a javascript engine for executing client-side javascript and the extender does not (because it is not a browser.)  This fact only emphasizes the point that the extender is not IE bassed.   The extender provides access to several Windows system libraries that in turn provide access to several communication protocols - like HTTP and FTP - built on top of TCP/IP.

Web scraping is not a topic that is mentioned much anymore.  It may be because sites have become more API based and offer (micro)services via those APIs.  If you can't or don't want to use IE COM Automation objects and want an alternative, you can conduct a search of this site, the Tech Database, and the Internet.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

Just throwing this out there....Unsure if you will find it helpful or not...

         https://developers.google.com/web/updates/2017/04/headless-chrome

Could possibly automate the use of this with WinBatch to get the full page and display the results in a Browser control.

Jim