The year 2016 is almost over. It’s time to take a break from typical technical posts and talks about what was done and what to be done. 2016 was the year I got involved in many new things, new in a sense that I had left them long time back and resumed again. I resumed blogging this year and 2016 is the year I was more active than yesteryears. I also started reading books, though I was not good at it but at least better than past. Here’s the list of books I read in 2016 plus a couple of Urdu books are not enlisted on Goodreads. I am targeting…
-
-
Write a Gmail autoresponder by using Python Selenium
In earlier posts(here and here) I discuss how to use Python requests and beautifulsoup library to access and scrape a website. This time I am going to make a simple Gmail Autoresponder that responds to a certain mail. Before I discuss how to do it, a few words about Selenium and why is it going to make our life easier. Advantages of Selenium What one is going to achieve with Selenium by not opting for a lightweight solution based on Python requests and beautifulsoup? Selenium actually automates browser activities by simulating clicks and other events and makes easier to access information that is accessible after executing Javascript on page. Since it’s automating…
-
How to speed up your python web scraper by using multiprocessing
In earlier posts, here and here I discussed how to write a scraper and make it secure and foolproof. These things are good to implement but not good enough to make it fast and efficient. In this post, I am going to show how a change of a few lines of code can speed up your web scraper by X times. Keep reading! If you remember the post, I scraped the detail page of OLX. Now, usually, you end up to this page after going thru the listing of such entries. First, I will make a script without multiprocessing, we will see why is it not good and then a scraper…
-
How to optimize website speed and performance by using free tools
Developing a website is not enough these days. Even developing an “awesome looking” website is not only going to serve your purpose unless it loads faster and rank better on Google. In an earlier post I discussed how you can use free SEO Tools to rank better on Google but Google’s core search algorithm has been evolving continuously and now they are also taking site speed into consideration. For that purpose they are relying on their own tool called Page Speed which helps you to figure out what Google thinks about your website. The goal The goal is: how a developer, a front-end developer/designer or.. even a backend developer like me…
-
How to develop an efficient web scraper in Python
Last week I was working on a web scraper for a client who needed to get around a million records from a real estate website. After a certain level, the scraper stopped working and the reason was I forgot to put certain checks as I was expecting the client would not go for that route but he DID! A few days back I shared a post about how to write a basic scraper in Python by using Beautifulsoup. In this post, I am going to discuss how to make your scraper more foolproof and user-friendly for non-technical people. 1- Check 200 status code It is always good to check the…
-
3 Free SEO tools you should use for your next blog post
Blogging is not only the best way to express your thoughts and feelings in words but also good to reach your potential audience. These days the best way to reach your audience is to let people visit your site by finding you via Google. How do they find you? Well, they write something(called Keyword) and search about it and click on the link they think would be more helpful and interesting. After all this is how Google or any search engine work right? Many software developers who maintain blogs usually don’t care about their audiences( I’m one of them), they are excited and passionate enough that they just share their findings…
-
Write your first web scraper in Python with Beautifulsoup
Ok, so I am going to write the simplest web scraper in Python with the help of libraries like requests and BeautifulSoup. Before I move further, allow me to discuss what’s web/HTML scraping. What is Web scraping? According to Wikipedia: Web scraping (web harvesting or web data extraction) is a computer software technique of extracting information from websites. This is accomplished by either directly implementing the Hypertext Transfer Protocol (on which the Web is based), or embedding a web browser. So use scraping technique to access the data from web pages and make it useful for various purposes (e.g: Analysis, aggregation etc). Scraping is not the only way to…
-
How I wrote my first Machine Learning program in 3 days
A few weeks back I was intrigued by Per Harald Borgen’s post Machine Learning in a Week which oversimplified the entire learning and implementing a Machine Learning algorithm in a week on a real dataset. He laid down the framework that how as a programmer one can get into ML thing without getting worried about heavy maths and statistics. It was a good excuse to give this ML thing a chance which I had been trying to do for many years after completing Coursera course. Alright. So on this Monday I started my mission. I had to find out some good dataset to achieve the task. Initially I wanted to use NASA’s meteorites…
-
Mbstring not found error while installing mailparse PHP extension
Today I had to install mailparse via PEAR. On installing I came across one of the errors: mbstring not found despite of it was right there. One of the simplest option to fix it is given below. Though I am working on MAMP but it will work with anyone since it’s part of PHP Source. Go to your PHP Source Library. In my case it is: /Applications/MAMP/bin/php/php7.0.8/include/php/ext/mbstring/libmbfl/mbfl and add following lines in mbfilter.h #undef HAVE_MBSTRING #define HAVE_MBSTRING 1 and then run PEAR command again pear install pecl/mailparse If all goes well it should give something like: Build process completed successfully Installing '/Applications/MAMP/bin/php/php7.0.8/lib/php/extensions/no-debug-non-zts-20151012/mailparse.so' install ok: channel://pecl.php.net/mailparse-3.0.1 configuration option "php_ini" is not set to…
-
Currently Reading – Chrome extension about social book reading
I love reading books, in fact lots of books. I’am sure many of you read books as well. Books on different topics and subjects help you to expand the horizon of knowledge and creativity. Often it happens that you extract an idea from a book and you give your own touch in it and produce a product which people love to use. In the age of social media when people love to let others know about their daily activities by updating a status, it ‘s not surprising that there are such social sites available which let your friends know about what you’re reading. Goodreads is one of them which…