0

I am trying to get source code of a web page using simple html dom. I am using this code -

include('simple_html_dom.php');

$html = file_get_html("http://freelancers.net/project");

But it's showing this error:

Warning: file_get_contents(https://twitter.com/BenAffleck): failed to open stream: No connection could be made because the target machine actively refused it. in C:\xampp\htdocs\simple_html_dom.php on line 75

I am sure my code is correct because it will work on a web server but I am trying to run it on localhost (I have Xampp Installed). I don't know why it is not working. I am using proxy server to connect with internet if has something to do with it. I have read some posts on stackoverflow and there are some answers about port blocking but I have no idea how to do that. I am using 127.0.0.1 to navigate to localhost. I am using Windows. Any help?

  • Possible duplicate of [No connection could be made because the target machine actively refused it 127.0.0.1:3446](http://stackoverflow.com/questions/9695224/no-connection-could-be-made-because-the-target-machine-actively-refused-it-127-0) – Tigger Nov 05 '16 at 09:20
  • They could be blocking you, try using a VPN. – pguardiario Nov 06 '16 at 01:50

0 Answers0