Answer the question
In order to leave comments, you need to log in
What is the best method to use to get information and content from another site?
Hello!
It is required to get data from one site that displays information about the product after a get-request.
Suppose a page with information about a product can be found at site.com/?article=nbX123q
--------------- I
found two methods on the Internet:
1. Using file_get_contents()
2. Using loadHTMLFile
- --------------
I have not done such tasks yet, so the question is: which one is better to use? Maybe there are some convenient libraries for this. Since, to be honest, I need to get different information from two similar sites and display it on ours.
And such a moment is interesting: on the second site, data can be loaded for a long time, all this time there is a loading animation hanging in place of the block with info. If you use the above two methods, will they wait for the content to fully load, or will they parse the page during ajax loading?
Answer the question
In order to leave comments, you need to log in
none of the above. Smoke curl. Regarding ajax requests - none of the methods are executed, either you use a browser simulator, or you execute them yourself
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question