473,404 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

How do you programmatically expand a url link to its true location?

xarzu
88 64KB
How do you programmatically expand a url link to its true location?

Do you know about tinyurl.com and baidu.com? Baidu.com is a search engine that tries to discourage people from using their web site to make metasearch engines by hiding their links in a way that is a lot like how tinyurl.com works. TinyUrl.com is a web site where, if you want to present someone with a link to something and that link is long, you can use tinyurl to produce a tiny url for presentation purposes.

Anyway, what I want to do is to find a way to programmatically take the link http://www.baidu.com/link?url=mW91GJqjJ4zBBpC8yDF8xDhiqDSn1JZjFWsHhEoSN d85PkV8Xil7qccoOX3rynaE (the first link in a search for Jessica Alba using baidu.com) and have it return the actual link, http://baike.baidu.com/view/270790.htm . That is just one example. What I want to do is not specific to Jessica but for using Baidu.com as part of my group of search engines in my meta search eneing project.

Maybe there is a way of using the WebBrowser class but I did not see a member that was the URL.

Maybe there is a way of using WebRequest and WebResponse.
Nov 28 '12 #1
8 2765
Rabbit
12,516 Expert Mod 8TB
You'll have to automate visiting the site and letting it resolve fully and then grab the url.

Also, the web browser class does have a URL property.
Nov 28 '12 #2
xarzu
88 64KB
@Rabbit
How does one grab the URL?
Nov 28 '12 #3
Rabbit
12,516 Expert Mod 8TB
You mean from a web browser object?
Expand|Select|Wrap|Line Numbers
  1. webbrowser.url
Nov 28 '12 #4
xarzu
88 64KB
Is that with WPF?

With WPF:

Expand|Select|Wrap|Line Numbers
  1. WebBrowser webbrowser1;
  2.  
  3. webbrowser1.url <-- does not exist.
Nov 28 '12 #5
Rabbit
12,516 Expert Mod 8TB
Here is microsoft's documentation on the url property of the web browser class.
http://msdn.microsoft.com/en-us/libr...owser.url.aspx
Nov 28 '12 #6
xarzu
88 64KB
It is too bad I am not using windows forms
Nov 28 '12 #7
Rabbit
12,516 Expert Mod 8TB
In that case, you can use the source property.
http://msdn.microsoft.com/en-us/libr...er.source.aspx
Nov 28 '12 #8
xarzu
88 64KB
Cool.

I will give it a try.

Thanks.
Nov 28 '12 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Steven | last post by:
Hello, I have a problem in using TreeView. I want to know how the TreeView can automatically Expand a path I have accessed before? I have tried to use "path.Expand()", but it seems no good...
3
by: Rich | last post by:
I am instnatiating a second form from a first form. I set startuplocation to manual, then I enter 100 for X and 300 for Y on the second form. Then on the click event of a button on form1 I have...
0
by: EricL | last post by:
Hello, I have written a Custom Control which inherits from ToolTip and it is an OwnerDraw tooltip. In the Popup event I calculate the size of the tooltip I need to display (rather large...
0
by: EricL | last post by:
Hello, I have written a Custom Control which inherits from ToolTip and it is an OwnerDraw tooltip. In the Popup event I calculate the size of the tooltip I need to display (rather large...
1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I change the text in the url/location bar?...
25
by: bubbles | last post by:
Using Access 2003 front-end, with SQL Server 2005 backend. I need to make the front-end application automatically refresh the linked SQL Server tables. New tables will be added dynamically in...
4
by: perryche | last post by:
Is this possible? Instead of using the link wizard, can the FE/BE link be established any other way that users can simply type the link path? Thanks, Perry
5
by: Joey | last post by:
I have the following in the head section of the ASPX page for my master page: <script language="javascript" type="text/javascript" src="MyCodeFile.js"></script> This includes my external...
11
by: Nospam | last post by:
I don't know what it is I am doing wrong, I am trying to get the menus to either expand or contract based on their previous states, i.e if already expanded if clicked again contract, and if...
5
by: Xu, Qian | last post by:
Hello All, I have some problem by simulating a link click using javascript. The webpage uses a js-library named interface (jQuery like) ------------------------------ <a id="foo" href="#">Try...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.