Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) |
Basic winsock trouble getting correct source

Post new topic   Reply to topic Printable version
 View previous topic  Listview Problem!!? Post :: Post how does a server send you redirect re...  View next topic  
Author Message


PostPosted: Mon Aug 13, 2012 12:45 am    Post subject: Basic winsock trouble getting correct source Reply to topic Reply with quote

Hi i'm trying to make a simple program to get first 512 characters from source page of macys webpage.

simple code
Code: Show/Hide

   string url = "GET";
   url += argv[1]; // Add product id to URL
   url += "\r\nHTTP/1.1\r\n";
    url += "Host:\r\n";
    url += "Connection: close\r\n";

   char buf[BUFFSIZE]; // 512

   send(sock,url.c_str(),url.length(),0); // Send socket


The problem is the following. Lets say products web id is 546916 so url would be

The source i recieve is
Code: Show/Hide

            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "">
            <html xmlns:jsp="" lang="en-us">
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Not Found - Macy's</title>
<meta http-equiv="generator" content="JACPKMALPHTCSJDTCR">

<script type="text/javascript" language="JavaScript">
                              function getForwardPageURL()

While infact if you put the URL into the web browser the source should be

Code: Show/Hide
<!DOCTYPE html>
<html lang="en-us">
<title>JS Boutique Dress, One Shoulder Draped Evening Dress - Womens Dresses - Macy's</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="generator" content="JACPKMALPHTCSJDTCR" />

The meta name robots in the source that my program recieves makes me feel macys did something. what can i do? please help.
Back to top
Wow Cheese is so helpful!

Joined: Mar 18 2007
Posts: 1017

PostPosted: Wed Aug 15, 2012 1:38 pm    Post subject: Reply to topic Reply with quote

user agents are different, and the content it sends is different accordingly

also your get is wrong, thats a 404 page
SSC Distension Owner
SSCU Trench Wars Developer
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address


PostPosted: Tue Sep 04, 2012 4:14 pm    Post subject: Reply to topic Reply with quote

kinda pointless to post but just figured if any one comes across the problem (4e-60000% chance) but its google which after sending about 700 requests to google search it asks for a captcha :\
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Non-Subspace Related Coding All times are GMT - 5 Hours
Page 1 of 1

Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List

Software by php BB © php BB Group
Server Load: 68 page(s) served in previous 5 minutes.

phpBB Created this page in 0.073436 seconds : 29 queries executed (57.1%): GZIP compression disabled