In this tutorial, we show you how to add a column after or before of an existing column in MYSQL. Using ALTER and ADD commands in MYSQL Syntax is given below Example: Adding new column after an existing column
Python selenium script to open a webpage and click a button automatically using it’s xpath. Example script to open a webpage and click a button In below code, we open gethowstuff.com home page and click on ‘Subscribe’ button. To use the code replace the URL with yours and replace xpath of your desired button on […]
Below are the simple steps to find XPath of a button on a web page in Google Chrome. Let’s try to find the XPath of ‘Subscribe’ button on Gethowstuff.com’s homepage. Steps to find XPath of button Open Gethowstuff.com in Google Chrome Right-Click on Subscribe button and click on Inspect 3. Right-Click on the highlighted area […]
Excel VBA macro to format abbreviated data to numbers. For example, 1.1k to 1100 (k to thousands), 2.1lacs to 210000 and 1mil to 1000000. The advantage of this macro is that you don’t need to format each number. The macro detects the text (k, lacs, mil and cr) and does the math. Before you run […]
Below are the instructions on how to install chrome driver or (webdriver for Chrome) on Windows 10 PC. You have to download the right version of chrome driver, otherwise you will get error like below when you try to run the code using selenium webdriver in Python. SessionNotCreatedException: Message: session not created: This version of […]
Python code to extract href links from webpage using Selenium webdriver. If you are using any firewall setting, make sure to whitelist the webpage from where you want to fetch the links or turn off the anti-virus software. Notes: Replace PATH TO WEBDRIVER EXE FILE (on line 4) with the chromedriver.exe path on your PC […]
You can create a new image in Python using PIL library’s Image.new() method. Syntax: Image.new(mode, size, color) Parameters:mode – type of pixel (RGB, HSV etc). Check the modes supported by Python size – a tuple, (width, height) in pixels color – color of the new image. default is black (=0). Example#1 Creating an image of […]
Extract image pixel values, insert them in excel sheet using Python Openpyxl module.It also fills each cell background color with corresponding pixel’s RGB color. Extract pixel values from image In this code, we use Python PIL getpixel method to extract the pixel data. RGB to Hex conversion getpixel() method returns RGB color value (x, y […]
Simplest way to download an image from it’s URL using Python wget module’s download method. Contents Syntax Examples Code#1 Code#2 Prerequisites:1. Install wget library Syntax: get.download(URL, Target Directory (optional)) Parameters: URL – Image URL Example: https://gethowstuff.com/wp-content/uploads/2020/03/python-crash-course-001.jpg Target Directory (optional) – Path where downloaded image will be saved. Otherwise, it will be saved to current working […]
Python PIL getpixel() method provides image data at pixel level. You can extract the pixel value by passing it’s (x,y) coordinates. getpixel() Syntax Syntax: getpixel(xy) Parameters: xy, pixel coordinates represented as a tuple (x,y) i.e.(row, column) Returns: a pixel value for single band images (grey-scale images), a tuple of pixel values for multi-layer images. For […]