HOME 프로그램 개발실 웹 로그인 자동화

API , OPEN Interface 소스로 맞춤 프로그램 개발하는 페이지 입니다.



from django.shortcuts import renderfrom django.http import HttpResponsefrom urllib.request import urlopenimport requestsimport urllib.requestfrom bs4 import BeautifulSoupfrom yarl import URLfrom bs4 import BeautifulSoup as bsimport scheduleimport sched, timeimport pymysqlfrom datetime import datetime, timedeltafrom threading import Threadfrom time import sleepfrom selenium import webdriverimport webbrowserfrom selenium import webdriverdef index(request):    return HttpResponse(

웹 로그인 자동화

버전
0.1
작업모듈
python + webdriver +pymysql
환경
window

본문

패키지 정보

from django.shortcuts import render

from django.http import HttpResponse

from urllib.request import urlopen

import requests

import urllib.request

from bs4 import BeautifulSoup

from yarl import URL

from bs4 import BeautifulSoup as bs

import schedule

import sched, time

import pymysql

from datetime import datetime, timedelta

from threading import Thread

from time import sleep

from selenium import webdriver

import webbrowser

from selenium import webdriver



def index(request):

    return HttpResponse("111")





def do_txt(a,b, x): 

print('창열기')

driver = webdriver.Chrome('C:\dev\page_project\src\chromedriver.exe', chrome_options=options)


print('로그인창')

time.sleep(2)


continue_link.click()

time.sleep(5)


driver.quit() 

      driver 종료


s = sched.scheduler(time.time, time.sleep)



MySQL Connection 연결

conn = pymysql.connect(host='localhost', user='root', password='1111',db='keyword', charset='utf8')

curs = conn.cursor(pymysql.cursors.DictCursor)



def do_something(sc): 

now_time = datetime.now().strftime('%H:%M:%S')

print ('Doing stuff...' + str(now_time))

do your stuff


 

sql = "select * from gword where num=%s"

curs.execute(sql, (1))


sql = "select * from gword"

curs.execute(sql,)


 

rows = curs.fetchall()

for row in rows:

    print(row)


    print('id:'+row['title1'] + ', pw:' + row['title2'])


    do_txt(row['title1'], row['title2'], row['sok'] )



conn.commit()



s.enter(10, 1, do_something, (sc,))


s.enter(10, 1, do_something, (s,))

s.run()


conn.close()



while True:

    Code executed here

    print('test')

    time.sleep(60)





#웹크롤러 #자동화작업 #pymysql #python





[주소복사] https://www.goodsweb.kr/?u=D41dX3R6
SNS 알리기
핀터레스트
텔레그램로
블로그로
카카오스토리
카톡 공유

관련 블로그
로딩중


2명  IP : 3.16.♡.124
001 13.♡.61.119 시스템 개발일정 xls - 양식다운로드
(/bbs/board.php?bo_table=papers&wr_id=7)
002 222.♡.190.67 굿스웹 - 홈페이지 유지보수 관리
(/)

접속자
  • 오늘 : 322
  • 어제 : 343
  • 최대 : 874
  • 전체 : 401,371

검색로봇(Robots) 최근 방문시간
  • GOOGLE : 16분 전
  • BING : 53분 전
  • NAVER : 11시간 전
  • DAUM : 3일 전

ETH : 0x8abf3B748ab78828AE07685e4fd53d1a606f18D3



페이스북 네이버 블로그 굿스웹 쇼핑몰 네이버 카페 굿스웹 트위터 굿스웹 티스토리 Google Play