I have this HTML,
<div class="header1" style="text-align: center;">
<div class="s">
<center>
<table>
<tr>
<td>
<ul style="position: relative;">
<li>
<a>
<p>
Apple Kid
</p>
and I want to get the the word "Apple kid" as an output using Swift.
I used the TFHpple Framework for this, but after adding all the necessary things it showing an error. Like in the Objective-C file
the XPathQuery.h
//
// XPathQuery.h
// FuelFinder
//
// Created by Matt Gallagher on 4/08/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
NSArray *PerformHTMLXPathQuery(NSData *document, NSString *query);
NSArray *PerformHTMLXPathQueryWithEncoding(NSData *document, NSString *query,NSString *encoding);
NSArray *PerformXMLXPathQuery(NSData *document, NSString *query);
NSArray *PerformXMLXPathQueryWithEncoding(NSData *document, NSString *query,NSString *encoding);
It showing an error at these functions about Unknown type.
The XpathQuery.m
//
// XPathQuery.m
// FuelFinder
//
// Created by Matt Gallagher on 4/08/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "XPathQuery.h"
#import <libxml/tree.h>
#import <libxml/parser.h>
#import <libxml/HTMLparser.h>
#import <libxml/xpath.h>
#import <libxml/xpathInternals.h>
NSDictionary *DictionaryForNode(xmlNodePtr currentNode, NSMutableDictionary *parentResult,BOOL parentContent);
NSArray *PerformXPathQuery(xmlDocPtr doc, NSString *query);