This question already has answers here:
Fetching google images using htmlagilitypack
(3 answers)
Closed 8 years ago.
I am trying to fetch images from sites like Google images and yandex (a russian search engine).
I use xpaths for the purpose. While, on yandex, i am able to fetch the image thumbnails (ie, their urls), i am not able to fetch the bigger image (which is possibly javascript generated, when one clicks on the image).
On google images, I am not able to fetch even the thumbnails. The xpath that i use for google images is:
#"//div[#class='rg_di']/img"
Can anybody help me with this?
Try this XPath instead: #"//div[#class='rg_di']//img". You should note that the img tag is not directly under the div tag as your XPath expression states (// instead of /).
Related
This question already has answers here:
What does HTML.Raw do?
(4 answers)
Closed 4 years ago.
when I list out information from my database through C#, if the info contains html tags such a; pagagraph (p) or title (h1) it does not use them but simply list them out as is, I searched the internet and have not found a solution to my problem yet. What I've discovered is that people have had problems with saving their info onto the server that uses html tags but my problem lies in the fact that when the info is listed out the tags just stay text.
If you have HTML tags in a database that you want to appear on in a browser as text, you can convert them with HtmlEncode() so that <div> will be displayed on the screen instead of interpreted as the beginning of and HTML div.
If your prblem is the other way, where it's stored in your database as <div> and you want an actual div, you can use HtmlDecode.()
This question already has answers here:
Finding text on page with Selenium 2
(4 answers)
Closed 8 years ago.
How can I make a text call using selenium on a web page?
Should I use searchContext?
I tried using xpath but I get an error.
//***********************
okay all thanks. my code is working :)
var link = _driver.FindElement(By.XPath("//*/a[contains(.,'btctrader')]")).Text;
Well, this will check if text exists on the page:
driver.getPageSource().contains("Text");
But this is just one of many ways. You'd need to be more specific if this is not what you're looking for.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What is the best way to parse html in C#?
I'm trying to write some code which uses a HttpWebRequest with GET method (or any suggested faster function), find a keyword on the page and then display what comes after it in various textviews.
The homepage it looks up will always be the same and will always find the same lines but with different data.
I've read about something called HtmlAgilityPack a lot but I cannot figure out if I can use it for this, nor how to.
Is there any faster functions to use to just get and find data within source?
Can I use HtmlAgilityPack, if so how (example please)?
Is there any easier way this can be done?
cheersnox
Yes you can use HtmlAgilityPack, if you want to extract text from tags
HtmlAgilityPack is an HTML parser that builds a read/write DOM from “real world” HTML files. It supports XPATH or XSLT and is tolerant with "real world" malformed HTML
In one line it use's XPath queries that real helps in extracting data quickly
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Open/handle Word documents like SharePoint
I´ve developed one website where it is possible to upload docx files to it. Now I want a way to edit it directly in browser, I meant, a way to do like google docs does.
OR
Copy from MSWord to my app window e maintain all the formats, including tables.
for the manipulation of word documents you can use DocX. With this you can read/write from/to word documents (docx not doc). This however is a long way from editing your document in a google docs like manner...
It does match your second request though!
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
multiple upload images on c#/jquery
hey guys!
Yesterday i made here a question about an input type="file" to select multiple files instead of one. And you gave me some solutions like plupload and SWFUpload and some more.
But if possible i want to try something a little bit different, like facebook. The solution that you offered me yesterday have flash, or silverlight, html5, gears or browserplus...
So if you could show me an example like the photo upload of facebook or another i would be very happy!
Regards!
Try: Multiple Upload images with c#/jquery?
Facebook's uploader is a Flash uploader. View the source.