How to read a specific number from a HTML page [closed] - c#

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
for example , if I wanted to set the Index value from this page:
http://ca.finance.yahoo.com/q;_ylt=Agfc5O8HHTlOLgX.q6V4HEtyzJpG;_ylu=X3oDMTFkdnZqMHBkBHBvcwMyBHNlYwN5ZmlNYXJrZXRTdW1tYXJ5RnJvbnRwYWdlBHNsawNzcHRzeA--?s=^GSPTSE
to a variable, how can I do that??
I am VERY NEW to programming, I would really appreciate if you explained every line.
My point isnt to get it done, I want to understand it.
Thank you very much in advance!

If you look at the source code of the web page, you find that the index number is within a span tag which has a unique id: <span id="yfs_l10_^gsptse">13,702.33</span>.
This means that you can scrape the page and then single out that individual tag.
You need to start by connecting to the host and downloading the page. The way in which you do this depends on which language you're using. There are plenty of tutorials around - just search for "[language] web scraping".
Then you need to create a Document Object Model from the html source code - again, this depends on the language, it's easy in some and difficult in others. Once you've done that, simply search for the tag with an id of yfs_l10_^gsptse and grab the content.
Hope that helps - obviously there's a lot I haven't said, but it depends what language you want to use.

Related

Already Existing User in MVC3 razor [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am doing project MVC3 razor whaen I was inserting the data that would be saved in database.If the user is already in database that username should't be saved in database and one error msg has to be displayed how can I write the code for this?
You open up your favourite code editor and type away. Unless you don't have fingers - in which case I don't know.
(Anticipating -1's)
In all seriousness, though (and this should be a comment but because I've added an answer I'm going to put it here) - how can you expect anybody here to give you a straight answer to this question. You have not supplied any code, no information about your database schema, you haven't shown what you've tried (so we're assuming you've tried nothing). Ultimately this is a type of question repeated many many times here on SO and it always gets treated the same way - occasionally sarcastic comments - and I really do try not to do that any more, so sorry on this occasion - and closed within approximately 5 minutes.

What is the 'html-in-font' page called? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Simple enough question.
What is the 'aspx' or 'ascx' page called? I need the correct term to properly search google or define a question on here that should be fairly simple to answer, but I'm sure I'm not using the correct vocabulary so my question and google searches are not netting me anything.
To be clear, the 'code-behind' page is written in c#, I want to know what the page that would contain HTML and <% %> tags would be called.
I'm asking because another question of mine was answered very poorly and then ignored by everyone else and I think it's because I'm not sure how to name that page correctly. Going round the houses slightly but once I got my terms correct I can move to the next stage of solving my problem.
aspx page is actually the webform page where you define the markup like '<%' or html code. To keep things simple, we get the facility of having a seperate 'code behind' where we can write c# code. However, in aspx (webform) we can also write c# code, i am sure you must be aware of that.
ASCX page is nothing just a User Control page.
I hope i have answered your question. Just for information of whoever reads this post, ASPX is the enhanced version of a classic ASP page whose file extension used to be 'asp'. So when microsoft introduced ASP.NET they needed something that would reflect the advancement. So they named their page ASP+. As the windows doesn't allow a + sign as a file extension, they tilted the '+' sign and made it 'x'. This is how ASPX was derived.
I've always refered to the page as the "markup" page is that what you are after?

URL Tracking URL [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
We are programming a website which use UPS as shipping method. Administrator of the site must approve every order manually, create things propertly with UPS and then just get the tracking number and put it in our system. So we do not use any API from UPS or anything.
Is there a "static" URL like : http://ups.com/apage/{0} we may format to replace the {0} by the tracking number that the administrator will enter in our system?
I know I could search in google, but I'm not realy sure of what to write after UPS URL Tracking number didn't results me anything usefull.
You are required to use the UPS API when interacting with their system to either track packages or manage shipments. Any other use is in violation of their terms of service.
I don't know their terms of service as others have mentioned, but GMail just links to the following when it finds a tracking number in a message. I would assume you could use the same:
http://wwwapps.ups.com/WebTracking/processInputRequest?TypeOfInquiryNumber=T&InquiryNumber1=TRACKINGNUMBER
I'm sure this could end up changing at some point down the road.

extract meaning of a word in C# [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I m doing a project which invoves extracting the semantics of a word. While doing some resaerch I found out it's better to get Synonyms of a word rather than trying to extract semantics.
What is the best way of doing this. I only need to get the synonym of a word.
Please help.
Find a thesaurus. Pay attention to its licensing. E.g., Roget's Thesaurus. There may be one that is better-suited to being parsed programmatically.
Parse the thesaurus. For example, you could might store it in a Dictionary<string,List<string>>.
Look up entries as needed. How this is done depends on what data structure you stored it in. It's pretty easy in a Dictionary.
If you have trouble with a specific step in this process, feel free to ask. Your question is a bit too open-ending for me to know exactly what part to focus on.

Quote ticker in C# [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I want to make a Quote Ticker Control in C#
in which Live data should be come from stock exchange
How i will do it
Thanks
Read up on web services, it will probably be the best way to get upto date live information and then you'd use the results to update your control on your C# form.
This article should help you out!
Try to work out some of it and post specific questions.
Plan
Implement
Test
Deploy
Assuming this is for a web application, in addition to web services you will probably want to look into AJAX so you can refresh the data without having to postback the page.

Categories