doni49 Posted February 15, 2008 Share Posted February 15, 2008 I'm trying to write a screen scraper script. The path that I need to access is www.domain.com:2095/foldername/index.html. Is this possible? Thanks! Link to comment https://forums.phpfreaks.com/topic/91194-fsockets-wwwdomaincom2095foldername/ Share on other sites More sharing options...
doni49 Posted February 15, 2008 Author Share Posted February 15, 2008 Anyone out there know how to accomplish this? Link to comment https://forums.phpfreaks.com/topic/91194-fsockets-wwwdomaincom2095foldername/#findComment-467893 Share on other sites More sharing options...
kenrbnsn Posted February 15, 2008 Share Posted February 15, 2008 Did you try it? What happened? Show us your script. Ken Link to comment https://forums.phpfreaks.com/topic/91194-fsockets-wwwdomaincom2095foldername/#findComment-467896 Share on other sites More sharing options...
doni49 Posted February 16, 2008 Author Share Posted February 16, 2008 Yes I tried everything I could think of. I'm using the HTTPClient class--when I look through the class, I see that it's using fsockets to make the connection. I've tried both of the following. $hc = new HttpClient ("www.mydomain.com/foldername/",$port="2095"); $hc = new HttpClient ("www.mydomain.com",$port="2095/foldername/"); This is the portion of the HTTPClient class that creates the new object. function HttpClient($host, $port=80) { $this->host = $host; $this->port = $port; } And this is the portion of the class that actually attempts to make the connection if (!$fp = @fsockopen($this->host, $this->port, $errno, $errstr, $this->timeout)) { It returns a 404 error. With either method that I've tried. But when I visit this page in my web browser, the page loads fine. www.mydomain.com:2095/foldername/ Link to comment https://forums.phpfreaks.com/topic/91194-fsockets-wwwdomaincom2095foldername/#findComment-468126 Share on other sites More sharing options...
doni49 Posted February 16, 2008 Author Share Posted February 16, 2008 Anybody have any suggestions? Link to comment https://forums.phpfreaks.com/topic/91194-fsockets-wwwdomaincom2095foldername/#findComment-468481 Share on other sites More sharing options...
doni49 Posted February 17, 2008 Author Share Posted February 17, 2008 Well I've continued to research this. I installed LiveHeaders extension for firefox and was able to examine the headers that the pages send/receive. My script succeeds at getting the page. So I went back and looked at the headers when I access the page directly (not using my script) and it seems to load the page (the one that I've been trying to access) and then loads a DIFFERENT page--it's this second page that appears in my browser and I don't even see the first one. I'm having trouble figuring out how to access this second page. Link to comment https://forums.phpfreaks.com/topic/91194-fsockets-wwwdomaincom2095foldername/#findComment-468793 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.