<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Saurabh Kumar</title>
    <description>The latest articles on DEV Community by Saurabh Kumar (@seikhchilli).</description>
    <link>https://dev.to/seikhchilli</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F812563%2F7af4defe-13d8-40bb-992f-204d58c08581.png</url>
      <title>DEV Community: Saurabh Kumar</title>
      <link>https://dev.to/seikhchilli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/seikhchilli"/>
    <language>en</language>
    <item>
      <title>Instagram Automation using Python and Selenium</title>
      <dc:creator>Saurabh Kumar</dc:creator>
      <pubDate>Sun, 06 Mar 2022 07:15:04 +0000</pubDate>
      <link>https://dev.to/seikhchilli/instagram-automation-using-python-and-selenium-3jp</link>
      <guid>https://dev.to/seikhchilli/instagram-automation-using-python-and-selenium-3jp</guid>
      <description>&lt;p&gt;In this tutorial, I have used Python and Selenium. I am assuming that you know the basics of Python.&lt;/p&gt;

&lt;p&gt;In case, if you don't have Python installed, you can download it from &lt;a href="https://dev.tourl"&gt;https://www.python.org/&lt;/a&gt; and follow the install instruction.&lt;/p&gt;

&lt;p&gt;After Python, we need to install Selenium Automation Framework. We will be using pip to install Selenium.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -m pip install Selenium
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we will need to install ChromeDriver. You can download it from &lt;a href="https://dev.tourl"&gt;https://chromedriver.chromium.org/downloads&lt;/a&gt;. After downloading, unzip it and move it to some sensible location.&lt;/p&gt;

&lt;h2&gt;
  
  
  Automate Instagram
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os
from typing import KeysView
from selenium import webdriver
from selenium.webdriver.common import keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys

os.environ['PATH'] += r"C:\Users\saura\Desktop"  #replace it with path that contains ChromeDriver
driver = webdriver.Chrome()

driver.get("https://www.instagram.com/?hl=en")

driver.implicitly_wait(5)

try:
    username = driver.find_element_by_name("username")
    password = driver.find_element_by_name("password")
except:
    print("no element found with this name")

username.send_keys("your_username")  #replace it with your instagram username
password.send_keys("your_password")  #replace it with your instagram password
password.send_keys(Keys.RETURN)

try:
    not_now = driver.find_element_by_class_name("cmbtv")
except:
    print("no element with this class name")

not_now.click()

try:
    not_now2 = driver.find_element_by_class_name("HoLwm")
except:
    print("no element with this class name")

not_now2.click()

see_all = driver.find_element_by_link_text("See All")
see_all.click()

for i in range(1, 30):
    follow_link = driver.find_element_by_xpath(f"html/body/div/section/main/div/div[2]/div/div/div[{i}]/div[3]")
    follow_link.click()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy this code and paste it in your Python file with (.py) extension. Replace path to ChromeDriver and username and password in code. And then run it. It is completely automated. Just sit back and relax.&lt;/p&gt;

</description>
      <category>python</category>
      <category>selenium</category>
      <category>instagram</category>
      <category>automation</category>
    </item>
    <item>
      <title>WhatsApp Automation using Python and Selenium</title>
      <dc:creator>Saurabh Kumar</dc:creator>
      <pubDate>Sat, 19 Feb 2022 07:25:32 +0000</pubDate>
      <link>https://dev.to/seikhchilli/whatsapp-automation-using-python-and-selenium-73l</link>
      <guid>https://dev.to/seikhchilli/whatsapp-automation-using-python-and-selenium-73l</guid>
      <description>&lt;p&gt;In this tutorial, I have used Python3 and Selenium. I am assuming that you know the basics of Python.&lt;/p&gt;

&lt;p&gt;If you don't have Python installed, you can download it from &lt;a href="https://dev.tourl"&gt;https://www.python.org/&lt;/a&gt; and follow the install instruction.&lt;/p&gt;

&lt;p&gt;After Python installed, we will need to install Selenium Automation Framework. We will be using pip to install Selenium.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -m pip install Selenium
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we will need to install ChromeDriver. You can download it from &lt;a href="https://dev.tourl"&gt;https://chromedriver.chromium.org/downloads&lt;/a&gt;. After downloading, unzip it and move it to some sensible location.&lt;/p&gt;

&lt;h2&gt;
  
  
  Automate WhatsApp
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os
from typing import KeysView
from selenium import webdriver
from selenium.webdriver.common import keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys

os.environ['PATH'] += r"C:\Users\saura\Desktop" #replace it with path that contains chromedriver
driver = webdriver.Chrome()

driver.get("https://web.whatsapp.com/")

driver.implicitly_wait(5)
try:
    destination = driver.find_element(By.XPATH, "//span[.='Friend']")#replace Friend with your WhatsApp contact
    destination.click()
except:
    destination = driver.find_element(By.XPATH, "//span[.='Friend']")#replace Friend with your whatsApp contact.
    destination.click()


msg_area = driver.find_element(By.CSS_SELECTOR, "[title*='Type a message']")
for i in range(20):    #Number of time message will be sent.
    msg_area.send_keys("Hi")     #Replace "Hi" with whatever message you want to send.
    msg_area.send_keys(Keys.RETURN)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the code and paste it in your Python file with (.py) extension. Replace drivers path and WhatsApp contact in code. And then run it. It will show a WhatsApp web interface. Scan the QR code. And you are done.&lt;/p&gt;

&lt;p&gt;Now you can change the code, according to your various requirements.&lt;/p&gt;

</description>
      <category>python</category>
      <category>automation</category>
      <category>whatsapp</category>
      <category>selenium</category>
    </item>
  </channel>
</rss>
