Antwise community forums
Open link - Printable Version

+- Antwise community forums (https://forums.antwise.com)
+-- Forum: Antview (https://forums.antwise.com/forumdisplay.php?fid=11)
+--- Forum: Antview for Windows (https://forums.antwise.com/forumdisplay.php?fid=12)
+--- Thread: Open link (/showthread.php?tid=209)



Open link - carlos@agpsoftware.com - 2024-12-09

There are in a web page this kind of link. I know how to navigate to target with a click, but i'd love to open in in another instance of browser, because the 'GoBack' function is really slow.
Is it possible to get the final url to open this in another browser instance?
Thanks in advance.


Code:
<a id="viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1:enlaceExpediente_0" 
href="#" onclick="if(typeof jsfcljs == 'function'){jsfcljs(document.forms['viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1'],{'viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1:enlaceExpediente_0':'viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1:enlaceExpediente_0','TIPO_LICITACION':'0','ACTION_NAME_PARAM':'SourceAction','idLicitacion':'1442041953','TIPO_ORIGEN':'busquedaVIS'},'');}return false" class=" "><span id="viewns_Z7_AVEQAI930OBRD02JPMTPG21004_:form1:textoEnlace_0">SE13724001023</span></a>



RE: Open link - wila - 2024-12-09

Hi,

The navigation is done via function jsfcljs .. so we're missing part of the puzzle, it's a bit of a reverse engineering exercise if you go down that route.

Are you initiating that click programmatically?
If so then another possibility might be to try something else.
You could set a global variable before you process that click and then use the state of that global variable to act specifically on the click.

There's the event OnNavigationStarting with parameter Arg of type AntViewNavigationStartingEventArgs
You could cancel navigation in the current control by setting Cancel to true, get the URI and request headers for use in another instance of the browser control.

Something along those lines might work.

--
Wil


RE: Open link - carlos@agpsoftware.com - 2024-12-09

Seems to be creating link on the fly:

URI:
https://contrataciondelestado.es/wps/portal/!ut/p/b1/jZHLbsMgEEW_KGLMy7DEOAZHaeNHcGs2FYuqSpXHpur3F6xIXQVndiPO5cAM8mjeSCFBslJi9I78NfyevsLP6XYN59R7_kG3B60bi0GMpAa8r53jNrUpMEcAHpSCJV-NQqiqUADECVC877WM94Ak9zwjmk67qeNjawBa29R7VzAwmD_nzwhSXk3bXrWSAEhdAR4UHYzD8bi85x8JDH7OnxHk8oat-dma_w35BclNcAFyK8o_EqNXe7t8ojli5f9XD9UQsV33cuwMLgAoOqLZrFE8URZd_LlJJdtvGjZB_QFGj32q/dl4/d5/L2dJQSEvUUt3QS80SmtFL1o2XzRFT0NDRkgyMDhTM0QwMkxEVVU2SEgyMEc1/?nID=Z6_4EOCCFH208S3D02LDUU6HH2082&cID=Z6_4EOCCFH208S3D02LDUU6HH2082

Headers:
{"headers":[{"name":"sec-ch-ua","value":"\"Microsoft Edge\";v=\"131\", \"Chromium\";v=\"131\", \"Not_A Brand\";v=\"24\", \"Microsoft Edge WebView2\";v=\"131\""},{"name":"sec-ch-ua-mobile","value":"?0"},{"name":"sec-ch-ua-platform","value":"\"Windows\""},{"name":"Upgrade-Insecure-Requests","value":"1"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0"}]}


RE: Open link - wila - 2024-12-09

Hi,

I'm not sure what the question is?

Yes, the function would create a link of some sort as it is navigating elsewhere based on the click (and whatever it deems relevant).
The headers look pretty much like standard headers to me and it seems you don't have to pass those.

Does it work if you provide the link to a new browser window?
That's what I would try.
--
Wil


RE: Open link - carlos@agpsoftware.com - 2024-12-14

(2024-12-09, 21:17:00)wila Wrote: Hi,

I'm not sure what the question is?

Yes, the function would create a link of some sort as it is navigating elsewhere based on the click (and whatever it deems relevant).
The headers look pretty much like standard headers to me and it seems you don't have to pass those.

Does it work if you provide the link to a new browser window?
That's what I would try.
--
Wil

Hi again. Of course i tried that and is not working in other browser. I found other link close to the main one that is working in any browser; luck situation.


RE: Open link - carlos@agpsoftware.com - 2024-12-14

(2024-12-14, 11:50:06)carlos@agpsoftware.com Wrote:
(2024-12-09, 21:17:00)wila Wrote: Hi,

I'm not sure what the question is?

Yes, the function would create a link of some sort as it is navigating elsewhere based on the click (and whatever it deems relevant).
The headers look pretty much like standard headers to me and it seems you don't have to pass those.

Does it work if you provide the link to a new browser window?
That's what I would try.
--
Wil

Hi again. Of course i tried that and is not working in other browser. I found other link close to the main one that is working in any browser; luck situation.

My project scheme, based on Antwise has advanced a lot. Now i get another deal: other kind of link that just works clicking but no copying to another browser; and also, gets open on another browser window. Any idea of how to get content that is a xml file?

Code:
<a class="celdaTam2" href="https://contrataciondelestado.es/FileSystem/servlet/GetDocumentByIdServlet?DocumentIdParam=SfyvBdFyChCU2HE55ukRyblgcVfOPZN3MwuLX1okxMm3utJjAobC/J/zvT02rxbiNpLEfQD7qxh21dJy69LVONdHDAX8JE/5tBI9WJIznD5JOVDbGCDM%2BMigrvuVS7Rv&amp;cifrado=QUC1GjXXSiLkydRHJBmbpw%3D%3D" title="Este documento se abrirá en una nueva ventana" target="_blank">Xml
</a>



RE: Open link - carlos@agpsoftware.com - 2024-12-15

(2024-12-14, 18:37:17)carlos@agpsoftware.com Wrote:
(2024-12-14, 11:50:06)carlos@agpsoftware.com Wrote:
(2024-12-09, 21:17:00)wila Wrote: Hi,

I'm not sure what the question is?

Yes, the function would create a link of some sort as it is navigating elsewhere based on the click (and whatever it deems relevant).
The headers look pretty much like standard headers to me and it seems you don't have to pass those.

Does it work if you provide the link to a new browser window?
That's what I would try.
--
Wil

Hi again. Of course i tried that and is not working in other browser. I found other link close to the main one that is working in any browser; luck situation.

My project scheme, based on Antwise has advanced a lot. Now i get another deal: other kind of link that just works clicking but no copying to another browser; and also, gets open on another browser window. Any idea of how to get content that is a xml file?

Code:
<a class="celdaTam2" href="https://contrataciondelestado.es/FileSystem/servlet/GetDocumentByIdServlet?DocumentIdParam=SfyvBdFyChCU2HE55ukRyblgcVfOPZN3MwuLX1okxMm3utJjAobC/J/zvT02rxbiNpLEfQD7qxh21dJy69LVONdHDAX8JE/5tBI9WJIznD5JOVDbGCDM%2BMigrvuVS7Rv&amp;cifrado=QUC1GjXXSiLkydRHJBmbpw%3D%3D" title="Este documento se abrirá en una nueva ventana" target="_blank">Xml
</a>

Hi again. I've finished, because of that i found:
These kind of links, created more or less 'on he fly', seems to work only if you continue in the same 'memory space?'... i can open them even in a msxml2.domdocument if it is created in the same applications; i also can open in the same browser instance of antview... but it doesn't works if you try on another browser, or in another browser tab.
Thank you very much for your help.


RE: Open link - wila - 2024-12-16

Hi,

You've been busy this weekend.
It's always a good test to see what happens if you use the Microsoft Edge browser and test to see if you can reproduce it in there, Microsoft Edge is using the same engine as WebView2.

As for not being able to open a link in another browser instance, it might be that this is limited by session cookies or a similar technique. It is possible that this is intentionally limited by the website.

Not quite sure what you mean with "I've finished".. do you still need help or have you found a solution?
--
Wil


RE: Open link - carlos@agpsoftware.com - 2024-12-16

Hi,
With 'I finished' i mean that benefits that i was expecting to obtain from Antwise, i got them. I'm now able to browse among the web sites my customer needs and get the whole information.

These kind of webs try to protect themselves by building random enormous links and also making them just working in the same browse instance; maybe, as you said, by cookies or anything similar. But is a hard deal.

I must continue with other web sites, so maybe I'll come back with new issues.
Regards,

P.D. If you want me to build a simple sample to publish for VFP developers, just make me know.


RE: Open link - wila - 2024-12-17

Hi,

I'm a little puzzled by your last statement about you willing to build a simple VFP sample.

The latest version of AntView comes with extensive code examples in VFP, did you not see them?
Is there anything specific missing?

Note that AntView 2.0, while currently in beta, has even more code examples for VFP.

--
Wil


RE: Open link - carlos@agpsoftware.com - 2024-12-17

I had no enough time to see VFP examples; but i will; for sure.
Anyway, all i saw up to now, go in another way: sending data and browsing but not retrieving info from cloud.
That's why i suggest to make another new kind of sample.
Ok. We'll see.

Thanks.


RE: Open link - wila - 2024-12-17

The VFP examples can be found via the start menu (AntView Examples) which will open Windows explorer in the correct location, or by navigating directly to it under C:\Users\Public\Documents\

For more info see also: Use AntView in Visual FoxPro

As for getting data out of the cloud.. AntView is a browser component and that is its main focus.
Yes, I'm sure you could do it via AntView, but if you have to directly interact with cloud API's then it might be easier to use another control that is specialized in interacting with cloud API's.

Personally I would use Chilkat for that kind of thing, they have a fantastic help that has tons of examples in foxpro code on how-to get data from the cloud.

See: https://www.example-code.com/foxpro/default.asp
Not affiliated, but I love their control and do recommend it.

If OTOH you need to interact with cloud interfaces that do not have a published API, you might not have that opportunity.
--
Wil