Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
suppose i typed on browser www.stackoverflow.com and press enter, browser makes a GET request to stackoverflow to access the resources(images,.css,.swf) but the problem with this i din want to have all url after www.stackoverflow.com

i need only one url that i searched for not all urls after it.

Thank you.
Posted
Comments
Sergey Alexandrovich Kryukov 23-Mar-15 10:17am    
Why? How can you tell one kind of URL from another?
—SA
anandd.mohit 23-Mar-15 10:42am    
As we know every URL have its unique host name so it give sense to be unique from another.

1 solution

It depends on what you are doing, but you should understand some thing.
Suppose you have sent an HTTP request, opened the response string and are reading the HTTP response. Before you read HTML file in full, you have some part of HTML, which is… not a valid HTML, so you cannot parse it in a standard way. Of course, you can ignore it and just add some HTML elements to your data one by one, those you can recognize, by some previously known features, to be elements representing the resources you are looking for. But how can you know where to stop? How can you know that, after some irrelevant URLs, you get some relevant again?

Again, it all depends on what you are doing. If you want to grab the site's response and represent it in some different, filtered way, perhaps you need to download the whole HTML, parse it, filter it, and produce the output you want, to present somewhere. If you want Stackoverflow to improve the way they respond to search request, address to them. :-)

—SA
 
Share this answer
 
Comments
anandd.mohit 23-Mar-15 10:36am    
Is there any relation between two GET request from same host means i type www.codeproject.com which in turns generate a GET request for www.codeproject.com/image.jpg , so is there any relation between them?
Sergey Alexandrovich Kryukov 23-Mar-15 10:42am    
GET request (HTTP request with the method "GET") does not come from "host". It comes from some TCP endpoint, from a client. If some Web site has the server-side code sending such secondary HTTP request (playing the role of a client to some other server), this could be possible, but there is no such predefined behavior, "relation" or anything like that. More exactly, the meaning of you question is not quite clear... It's possible that you are thinking based on wrong assumptions. And how is it related to your original question?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900