If the URL is directly input in the browser, the content is correctly displayed, but an empty string is returned when the content is obtained by a function or component such as CURL or filegetcontents. This problem occurs when I used PHP to capture Baidu dictionary content. This also happens when I capture 12306 of data a few days ago. Please... if the URL is directly entered in the browser, the content is correctly displayed, but the CURL or file
GetWhen a function or component such as contents obtains the content, an empty string is returned. This problem occurs when I used PHP to capture the content of Baidu dictionary. This also happened when I captured 12306 of the data a few days ago. How did they identify it? Is there any solution? Thank you!
Reply content:
If the URL is directly entered in the browser, the content is correctly displayed, but the CURL or fileGetWhen a function or component such as contents obtains the content, an empty string is returned. This problem occurs when I used PHP to capture the content of Baidu dictionary. This also happened when I captured 12306 of the data a few days ago. How did they identify it? Is there any solution? Thank you!
1. Set user_agent to the browser. 2. Set referrer correctly. 3. Add cookie4. other additional items.