Shubham Devkar
Published © CC BY

Url Visitor

URL VISITOR is SIMPLE SOFTWARE TO VISIT THE SAME URL MULTIP[LE TIMES WITH SPECIFIC VISITING TIME.

IntermediateProtip2 hours695
Url Visitor

Things used in this project

Software apps and online services

python3

Story

Read more

Code

Url visitor

Python
import urllib2
from bs4 import BeautifulSoup
from Tkinter import *
#from Tkinter.messagebox import *
import tkMessageBox
import webbrowser
import os
import time
new=1;
global num1
global num2
global num3
global num4
# Fetch the html file
response = urllib2.urlopen('http://myapk.co.in/python')
html_doc = response.read()

# Parse the html file
soup = BeautifulSoup(html_doc, 'html.parser')

# Format the parsed html file
strhtm = soup.prettify()

# Print the first few characters
usr = soup.username.string
pword = soup.password.string

def show_answer():
    count=0;
    global num1
    global num2
    global num3
    global num4
    url=num1.get();
    a=num2.get();
    b=num3.get();
    c=num4.get();
    print(a)
    while True:
        print(count)
        webbrowser.open(url,new=new);
        count += 1
        print(c)
        time.sleep(int(c))
        os.system("taskkill /T /F /IM " + b)
        if count >=int(a):
            break
    tkMessageBox.showinfo("Congrats" , a + "  Visit completed" )
    mainloop()

def login():
    if us1.get() == usr and pw1.get()== pword:
       i=Label(main,text='Login success').grid(row=7,column=0)
       main.destroy()
       global num1
       global num2
       global num3
       global num4
       def show_answer():
           count=0;
           global num1
           global num2
           global num3
           global num4
           url=num1.get();
           a=num2.get();
           b=num3.get();
           c=num4.get();
           print(a)
           while True:
               print(count)
               webbrowser.open(url,new=new);
               count += 1
               print(c)
               time.sleep(int(c))
               os.system("taskkill /T /F /IM " + b)
               if count >=int(a):
                   break
           tkMessageBox.showinfo("Congrats" , a + "  Visit completed" )
           Button(root, text='Quit', command=root.quit).grid(row=8, column=0, sticky=W, pady=4)
           mainloop()
       def refresh():
           root.destroy()   
       root = Tk()
       root.title("URL Visitor 1.0")
       Label(root, text = "URL:").grid(row=0)
       Label(root, text = "Url Visit count:").grid(row=2)
       Label(root, text = "Default browser as name.exe  e.g.opera.exe, chrome.exe, iexplore.exe, firefox.exe").grid(row=4)
       Label(root, text = "Visit Time").grid(row=6)
       num1 = Entry(root)
       num2 = Entry(root)
       num3 = Entry(root)
       num4 = Entry(root)
       num1.grid(row=1)
       num2.grid(row=3)
       num3.grid(row=5)
       num4.grid(row=7)
       Button(root, text='Logout', command=refresh).grid(row=8, column=0, sticky=W, pady=4)
       Button(root, text='Start', command=show_answer).grid(row=8, column=1, sticky=W, pady=4)
       mainloop()      
    else:
       j=Label(main,text='Login failed').grid(row=7,column=0)
line = 1
main = Tk()
main.title("URL Visitor 1.0")
main.geometry("400x150")
main.wm_iconbitmap('py.ico')
Label(main, text = "User name:").grid(row=0)
Label(main, text = "Password:").grid(row=2)
Label(main, text = "          Welcome to Url Visitor 1.0. For help http://myapk.co.in       ").grid(row=6)

us1 = Entry(main)
pw1 = Entry(main)

us1.grid(row=1)
pw1.grid(row=3)

Button(main, text=' Quit ', command=main.destroy).grid(row=7, column=0, sticky=W, pady=4)
Button(main, text=' Login ', command=login).grid(row=7, column=1, sticky=W, pady=4)
mainloop()

Credits

Shubham Devkar
13 projects • 14 followers
Experienced Electronics engineer, excellent at PCB Designing, control circuit development.circuit designing, hands-on experience with MCUs

Comments