0
votes

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 ..

1
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 wrongagg3l
I installed it as described here:htql.net/htql-com-manual.pdfMohamed Nasr
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 htql.net website start page - unzip archive sutable for your version of python into python installation DLLs subdirectoryagg3l
thanks it worked (Y)Mohamed Nasr
@agg3l you can post your reply as answerMohamed Nasr

1 Answers

0
votes

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