0

This is the first time to use python and need to import htql

when i run this code:

import htql;
page="<a href=a.html>1</a><a href=b.html>2</a><a href=c.html>3</a>";
query="<a>:href,tx";
for url, text in htql.HTQL(page, query):
     print(url, text);

i got the following error:

import htql; ImportError: DLL load failed: The specified module could not be found. error screenshot

i trys to to solve error as refered here ImportError: DLL load failed: The specified module could not be found

BUT error still exists!!

Also i am Installing the Visual C++ Redistributable für Visual Studio 2015 from this links: https://www.microsoft.com/de-at/download/details.aspx?id=48145 to fix the missing DLLs

BUT error still exists!

Please help!

THNAKS IN ADVANCE ..

Community
  • 1
  • 1
Mohamed Nasr
  • 65
  • 1
  • 12
  • this is definitely HTQL package broken setup or misconfiguration. Adjusting your question with description of how you did installed this package can shed some light on what went wrong – agg3l Nov 01 '16 at 07:04
  • I installed it as described here:http://htql.net/htql-com-manual.pdf – Mohamed Nasr Nov 01 '16 at 07:12
  • instructions within PDF manual are for COM interface (e.g. to use by C++ application), python does not use such. For usage from python scripts you should try in install it as described on http://htql.net website start page - unzip archive sutable for your version of python into python installation DLLs subdirectory – agg3l Nov 01 '16 at 08:03
  • thanks it worked (Y) – Mohamed Nasr Nov 01 '16 at 09:49
  • @agg3l you can post your reply as answer – Mohamed Nasr Nov 02 '16 at 05:42

1 Answers1

0

The problem of the questioner is he followed installation instructions from HTQL PDF-manual named Hyper-Text Query Language COM Interface, which obviously describes library setup for COM (Component Object Model by Microsoft), proposing regsvr32 <path-to-dll>. Intended to be used within win32-infrastructure aware applications first place

While there are means to use COM from within python (e.g. via pywin32 and others), it's not common method python script expects.

Proper solution is to follow instructions from HTQL home page, suggesting:

Windows binaries: Download the htql.zip and extract "htql.pyd" to the Python's DLLs directory, such as in 'C:\Python27\DLLs\' or 'C:\Python32\DLLs\'.

to install precompiled python .pyd module within python libraries search path

agg3l
  • 1,444
  • 15
  • 21