Hello. I am trying to get the page title of the following video's page using this CURL function: http://tinyurl.com/6duttha I use CURL to grab the whole page's content and then filter what's inside the <title> tags. However, the site checks if you have cookies and javascript enabled, otherwise it redirects to a page with a message saying that either of these two is not enabled. I figured that I can fake the cookie using the following: $cookie = "checkCookies=yes;TestIfCookie=ok;TestIfCookieP=ok"; curl_setopt($ch, CURLOPT_COOKIE, $cookie); PHP: However, I can't fake javascript enabled browser. Do you know how I can fake it with CURL so I can access the video page's title at least? Regards!
ruvenf: That's a PHP script to check if it's enabled. I need a solution to fake that it's enabled, because the CURL library is not a full-featured browser, and thus it doesn't contain a javascript parser.
Try using the user agent property. useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"; curl_setopt($ch, CURLOPT_USERAGENT, $useragent); Code (markup):