This article is a mirror article of machine translation, please click here to jump to the original article.

View: 23393|Reply: 1

[Source] C# Get the first image of HTML text and screenshot content summary sample code

[Copy link]
Posted on 8/8/2019 9:44:41 AM | | |
Get the first image

The data we want to obtain is a piece of HTML text, maybe there are many pictures in this text, and we need to take a screenshot as the title image, that is, as the main image, then we can use the following method to obtain the first image.

Sample code



Note: The one returned above is oneArrayListThe collection contains all the IMG src in the text, so that we can access the img src

Capture HTML text

Sometimes we get a piece of HTML text, and we need to capture a part of the HTML text as a content summary, in this case, we can use the following method

Sample code



summary

The above is the entire content of using C# to obtain the first image in a piece of HTML text and the summary of the content, I hope the content of this article can be helpful to you to learn or use C#.





Previous:500 super popular copyright-free music for vlogs
Next:.netcore wwwroot directory
 Landlord| Posted on 8/8/2019 10:00:56 AM |
Screenshot the specified length of HTML content and keep the HTML formatting markup (C# version)

Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com