0

I'm think about building a Silverlight C# Windows phone application for buses in Israel, and I have a basic question(or is it?).

The bus site which I want to get the data from uses Javascript. You need to type in the city you want to get to, and it returns the list of stations in that city.

I'd like to somehow "get" this page, type the code in, and get the results - all in C#. I'm pretty much lost on where to start from. How do I "get" the site code? how do I run the Javascript action that returns the stations, from within C#? is that even possible?

3
  • Barring licensing concerns for site scraping and potential presence of some sort of web-accessible API to use instead... Check out odie's answer at stackoverflow.com/questions/8826743/…. Commented Jan 13, 2012 at 17:47
  • I think that site made request to the server-side. Please, research what requests are between page and server-side are happens. Probably, you can make direct queries to the server from C# Commented Jan 13, 2012 at 17:49
  • I tried posting directly to the page, but I get an error that I don't have pop ups enabled. The Javascript doesn't reload the page, it posts the page in AJAX and returns the stations dynamically. that's where I'm stuck - trying to invoke that bit of code doesn't return an answer. Commented Jan 17, 2012 at 10:39

1 Answer 1

1

You can either use Fiddler to see where page get its stations from and read stations directly or you can load page to web browser control and invoke Javascript action that returns the stations if such script exists in page.

Sign up to request clarification or add additional context in comments.

2 Comments

I tried invoking the javascript action that does exactly that, only it doesn't return the station values. When I ran the javascript directly from Chrome, it did though.
What about running it directly in Internet Explorer 9 to see where is the problem?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.