html-parsing

Retrieving an array of images on HTML page using PHP

血红的双手。 提交于 2019-12-12 00:10:59
问题 I am retrieving images from a directory using php. Images are displayed on PHP page (getUser.php) but how can these images be display on any HTML. getUser.php <?php $dir = 'images'; $file_display = array('jpg','jpeg','png','gif'); if (file_exists ($dir) == false) { echo 'Directory \'', $dir, '\' not found!'; } else{ $dir_contents = scandir($dir); foreach($dir_contents as $file) { $file_type = strtolower(end(explode('.', $file))); If($file !== '.' && $file !== '..' && in_array($file_type,

Issue on parsing Html with jsoup

血红的双手。 提交于 2019-12-11 23:58:30
问题 I am trying to parse this HTML using jsoup. My code is: doc = Jsoup.connect(htmlUrl).timeout(1000 * 1000).get(); Elements items = doc.select("item"); Log.d(TAG, "Items size : " + items.size()); for (Element item : items) { Log.d(TAG, "in for loop of items"); Element titleElement = item.select("title").first(); mTitle = titleElement.text().toString(); Log.d(TAG, "title is : " + mTitle); Element linkElement = item.select("link").first(); mLink = linkElement.text().toString(); Log.d(TAG, "link

parsing tables with img tags in python with BeautifulSoup

谁说我不能喝 提交于 2019-12-11 23:25:47
问题 I am using BeautifulSoup to parse an html page. I need to work on the first table in the page. That table contains a few rows. Each row then contains some 'td' tags and one of the 'td' tags has an 'img' tag. I want to get all the information in that table. But if I print that table I don't get any data related to the 'img' tag. I am using soap.findAll("table") to get all the tables then chose the first table for processing. The html looks something like this: <table id="abc" <tr class=

Hpple implementation/Unrecognized selector

青春壹個敷衍的年華 提交于 2019-12-11 23:23:53
问题 I am working with the hpple html parser here: https://github.com/topfunky/hpple To test the function I've added it to a simple project and am able to compile and open the simulator without errors, but when it is called, I get an unrecognized selector error. //THIS ACTION SET TO RUN WITH THE PUSH OF A BUTTON - (IBAction)parseElements{ NSString *urlRequest = item.link; NSLog(@"urlRequest defined."); NSData *htmlData = [NSString stringWithContentsOfURL:[NSURL URLWithString: urlRequest] encoding

C# DNX parsing HTML

回眸只為那壹抹淺笑 提交于 2019-12-11 20:19:12
问题 I am trying to parse HTML on DNX (.NET Execution Environment), but I can't find way to do it. As I know DNX was made primary for cross platform web development, therefore there should be something? 回答1: You can try to use HtmlAgilityPack for .NET Core. It's port HtmlAgilityPack library to .net core, which used to parsing html on full .Net Framework. 回答2: I have finally manage to find a way to parse HTML documents. I have used System.Xml.Linq.XDocument class. It is fully supported on DNX, here

Parsing values from complex table using JSoup

安稳与你 提交于 2019-12-11 20:12:14
问题 I have a table with the following html: <TABLE class=data-table cellSpacing=0 cellPadding=0> <TBODY> <TR> <TD colSpan=4><A id=accounting name=accounting></A> <H3>Accounting</H3></TD></TR> <TR> <TH class=data-tablehd align=left>FORM NO.</TH> <TH class=data-tablehd align=left>TITLE</TH> <TH class=data-tablehd align=right>Microsoft</TH> <TH class=data-tablehd align=right>Acrobat</TH></TR> <TR> <TD><A id=1008ft name=1008ft>SF 1008-FT</A></TD> <TD>Work for Others Funding Transfer Between Projects

beautifulsoup: Parse Span Title

血红的双手。 提交于 2019-12-11 19:43:26
问题 I am trying to parse a html page, I have successfully got to the sub area of the tree of the html dom but I am stuck in a place where there are span tags. example: I initially parse the page as follows: user_url = base_url + str(user_id) + "/" + display_name user_page = urllib2.urlopen(user_url) souping_page = bs(user_page) badges = souping_page.body.find('div', attrs={'class': 'badges'}) badges will give me following: <span><span title="3 gold badges"><span class="badge1"></span><span class=

How to know the files inside the Tar parser

拟墨画扇 提交于 2019-12-11 19:35:28
问题 I am developing a visual c++ application . i need to know the file type (i mean whether it contains .png file or.html file or .txt file) present inside the tar file(just by c++ prgramming)-Nothing to deal with the commands. I have got some knowledge on the link below- how to parse a tar file here i have got information that at buffer[512] we have contents of a file present inside thge tar file.My first quesion is (1.) suppose if i have more then 1 files present in tar and i got the size from

Using Jsoup to extract data

狂风中的少年 提交于 2019-12-11 18:58:26
问题 I am using jsoup to extract data from a table in a website.http://www.moneycontrol.com/stocks/marketstats/gainerloser.php?optex=BSE&opttopic=topgainers&index=-1 using Jsoup. I have referred to Using JSoup To Extract HTML Table Contents and other similar questions but it does not print the data. Could someone please provide me with the code required to achieve this? public class TestClass { public static void main(String args[]) throws IOException { Document doc = Jsoup.connect("http://www

How can I extract data from an HTML table in PHP? [duplicate]

情到浓时终转凉″ 提交于 2019-12-11 18:49:35
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to parse and process HTML with PHP? Let's say I want to extract a certain number/text from a table from here: http://www.fifa.com/associations/association=chn/ranking/gender=m/index.html I want to get the first number on the right table td under FIFA Ranking position . That would be 88 right now. Upon inspection, it is <td class="c">88</td> . How would I use PHP to extract the info from said webpage? edit: I