Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Reply
select a random link from google
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
william king
10y
914
1
Reply
I Have an application that has a text box and a button and when you click the button it open up Ie and Google and searches for what was typed into the text box. but i need it to than select a random link from the generated results every time. Anyone know how to do this? Here is the code i have so far
namespace Search
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Btn_Click(object sender, RoutedEventArgs e)
{
using (var browser = new IE("http://www.google.com"))
{
browser.TextField(Find.ByName("q")).TypeText(_textBox.Text);
browser.Button(Find.ByName("btnG")).Click();
browser.WaitForComplete(5000);
System.Windows.Forms.SendKeys.SendWait("{Enter}"); // presses search on the second screen
browser.Button(Find.ById("gbqfb")/*.ByName("btnG")*/).Click(); // doesn't work
}
}
}
}
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
load report failed error in wpf.
how 2 add a movable vertical line in a graph of xy axis wpf