Python Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Python Examples

Quick Start
Unicode
Byte Array
Bz2
Certificates
CSV
Email
Encryption
FTP
HTML-to-XML
HTTP
IMAP
MHT
MIME
POP3
RSA
S/MIME
Signatures
Socket / SSL
SFTP
SMTP
Spider
SSH Key
SSH
SSH Tunnel
Tar
HTTP Upload
XML
XMP
Zip

More Examples...
String
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

 

Convert HTML to well-formed XML

Download Chilkat Python 2.5 Library

Download Chilkat Python 2.6 Library

Download Chilkat Python 2.6 Library (x64)

The Chilkat Python HTML-to-XML conversion component will convert any HTML to well-formed XML. After converting, existing XML parsers, tools, and libraries can be leveraged to extract (scrape) information.

The input/output files used in this example are provided here, along details explaining rules for conversion.

# file: htmlToXml.py

import chilkat 

# Python script to convert HTML files to well-formed XML

htmlConv = chilkat.CkHtmlToXml()
success = htmlConv.UnlockComponent("anything for 30-day trial")
if not success:
	print "component is locked!"
	sys.exit(0)


htmlConv.ConvertFile("exampleData/test1.html","output/test1.xml")
htmlConv.ConvertFile("exampleData/test2.html","output/test2.xml")
htmlConv.ConvertFile("exampleData/test3.html","output/test3.xml")



 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.