Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hello, i created a program that get data from wikipedia and show me in the text box. the problem is that it show the data with the code . for ex : when i type iron man it show me the data like this
HTML
<p><b>Iron Man</b> (<b>Anthony Edward</b> "<b>Tony</b>" <b>Stark</b>) is a fictional superhero appearing in American comic books
- but it should show me like this :
Iron Man (Anthony Edward "Tony" Stark) is a fictional superhero appearing in American comic books
. how to fix this issue ? or is there any option to use those codes ( to show bold characters in text box ) and create the text exactly like wikipedia in c# form ?

[edit]Code block added - OriginalGriff[/edit]

What I have tried:

i couldn't find a way to fix it.
Posted
Updated 10-Feb-17 0:38am
v5
Comments
F-ES Sitecore 10-Feb-17 6:25am    
Google "c# strip html from text" for sample code.

1 solution

Try looking at some of the links here: get text from html string c# - Google Search[^] - it's been covered a lot of times!
 
Share this answer
 
Comments
brandon1999 10-Feb-17 6:43am    
thank u so much.
OriginalGriff 10-Feb-17 6:54am    
You are welcome!
brandon1999 10-Feb-17 6:58am    
just one more question - how can i filter # ? cuz there is some sentences like fictional superhero #39 ( i want to filter - remove #39 )
OriginalGriff 10-Feb-17 7:03am    
I doubt if you can in practice: Wikipedia is a collaborative writing venture, and there is no one fixed way to present information to the user.
Since you are effectively scraping the page, unless the data has a common (and rigidly adhered to) layout and content standard then you pretty much have to take it all or risk losing the info the user is looking for. And wiki does not have that, or even close!
When you add in that wiki articles can be modified by anyone, and many, many times a day it's not a process that lends itself well to automation!
brandon1999 10-Feb-17 7:10am    
ok, thank u for everything. u r awesome man. if u can, give me some id or email, i wan't to ask u some questions sometimes.

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