Difficulty getting text or numbers from IFrame and using variables - Forum

Forum Navigation
You need to log in to create posts and topics.

Difficulty getting text or numbers from IFrame and using variables

Hello dear friends ! I will open an URL with IFrame! And this address shows me a number! I want to get this number and use it in the program! Thanks for pointing me to how this can be done. Thanks

@javadrajabihakami

Use this code:

BeginJS
$App.thecontent=$("#myiframe").contents().find("#myContent");
EndJS

Where myiframe is the IFrame object name and myContent the Container or <div> id with your content.
Your content will be stored in [thecontent] variable.

Thank you for your response, dear friend ! I enter the IFrame name correctly. But in the section ("#myContent") I put everything! I could not get the contents.

Uploaded files:
  • You need to login to have access to uploads.

@javadrajabihakami are you trying to get the content from another domain? That's not possible:

https://stackoverflow.com/questions/6170925/get-dom-content-of-cross-domain-iframe

You should use a server proxy script instead:

https://visualneo.com/forum/topic/loading-content-from-external-site-avoiding-cors

Regards.

Thanks for your response! Thanks for giving me a tip on how to do this: I have a site address that, when opened, gives me only a numeric code! A page opens with nothing in it! Except for one! How to get this number with a variable! Thanks

@javadrajabihakami the answer is on the second link:
https://visualneo.com/forum/topic/loading-content-from-external-site-avoiding-cors

Let me know if there is something there that you don't understand.
Regards.

Hi dear friend! I have not succeeded yet unfortunately! I created a folder in the program execution path and then put an index.php file in the folder! And I put the sample code inside! but I did not succeed ...

@javadrajabihakami Does this work for you?

FileToVar "https://visualneo.com/proxy/?url=https://yoururl.com" [MyVar]

Just change https://yoururl.com for the URL whose content you want to download into [MyVar]

Regards.


Hello and thank you for your response! Unfortunately it did not work ...

@javadrajabihakami is it possible to know the URL so I can check it?

https://RayganSMS.com/SendMessageWithUrl.ashx?Username=test123&Password=****&PhoneNumber=5000221030&MessageBody=test&RecNumber=09112112910&Smsclass=1

I want the same code that displays! Get

Hello! ... I think the best thing in this case would be to use Ajax. Try using the functions that visualneo brings for this.

javadrajabihakami has reacted to this post.
javadrajabihakami
Quote from Palamar on December 21, 2021, 5:15 pm

Hello! ... I think the best thing in this case would be to use Ajax. Try using the functions that visualneo brings for this.

Hello, thank you for your response, dear friend! Thank you for your kindness and for giving me a sample for help and guidance ...

@javadrajabihakami I think you will need a specific server side script. The web browser is blocking the script access to the content due to cross site scripting policies (CORS). The target URL doesn't allow CORS.

javadrajabihakami has reacted to this post.
javadrajabihakami
Quote from luishp on December 22, 2021, 9:51 am

@javadrajabihakami I think you will need a specific server side script. The web browser is blocking the script access to the content due to cross site scripting policies (CORS). The target URL doesn't allow CORS.

Hello and have a good time! Thank you for your response and guidance, dear friends