Skip to main content

Posts

Showing posts with the label Python

Solution : PyMSSql - import _mssql - ImportError: DLL load failed: The specific module could not be found

When you install pymssql module using pip in python and then try to import pymssql, you may end up with “ PyMSSql - import _mssql - ImportError: DLL load failed: The specific module could not be found ” error, if you are using pymssql version 2.1 or greater. This is due to security reason, pymssql now is not linked with SSL and FreeTDS, unlike previous version where SSL and FreeTDS were jointly linked with pymssql during installation. This information can be found on pymssql site found http://pymssql.org/en/latest/freetds.html#windows In order to overcome, we need to install supporting components FreeTDS and OpenSSL independently and then pymssql will work without any issue. Below are the steps to download and configure FreeTDS and OpenSSL. FreeTDS can be downloaded https://github.com/ramiro/freetds/releases And extract the file which is download. Now place the extract folder where your python module is installed.  (Can be kept anywhere but to avoid accide...

Classes, Methods, Objects..!!!! How do we relate to real world to understand it

Hello Everyone, Since, I started off my career, I was hearing about classes, Methods, publics, private, objects blab blab and I tried a lot to understand it but somehow I couldn’t get a chance to learn it properly. (I am Electronics and Communication Engineer, LOL) However, now I made one sincere attempt and learnt a bit of it, which I would like to share with you guys who are having trouble in understanding it, as it was with me. Let us get into some story how an organization works and from there, we will try to relate the classes, objects, methods. We all have come across how a Multi-National Company works. Consider for instance, Microsoft Inc. Microsoft is one of the top MNC, anyone would dream to work with. We also know that there are many departments in Microsoft. As example, Data Management team, Licensing Team, Marketing team, Development team, testing team etc. Everyone has their own functionality and work they do is different from each other though all are work...

Web Parsing using Beautiful Soup -Python

I am trying to scrap a website and extracting the data from it. For Demo purpose, I am using  http://www.w3schools.com/sql/sql_select.asp  website as it is one for simple and popular website for learning basic of programming languages. I am now concentrating on the values which are on left pane on this site. Let’s go to extract these keywords. For the web parsing, we should install beautiful soup. If we go to “Inspect element”, the HTML tag for the website looks like this: We now came to know that, the names or text, we need to extract is lying under “<a>” tag. To get all the data from “<a>” tag, use the following code. from bs4 import BeautifulSoup import urllib2 html="http://www.w3schools.com/sql/sql_select.asp" WebParse = urllib2.urlopen (html).read() soup = BeautifulSoup (WebParse) for ul in soup.findAll ('a'):     print ul And if we investigate, we can see there are lot of r...