Python Learning Access Script

Source: Internet
Author: User

#!/usr/bin/env python

#先导入功能模块

imprt webbrowser,time,os #浏览器功能, clock function, os bar with system command function

#定义变量

url = "" #填写要访问的地址链接

num = 0 #定义计数的变量


While True #死循环, always access the link

num + = 1 #每循环一次 technology plus 1

webbrowser.open_new_tab (URL) #使用功能模块访问指定的链接地址

Time.sleep (3) #延迟, give him a time buffer when it's open.

if not num%20 #设置在打开多少个之后 Kill the process and will consume memory if not killed

od.system ("Killall Firefox") #调用功能模块执行系统命令杀掉进程

===========================================================================================

#!/usr/bin/env python

imprt webbrowser,time,os #浏览器功能, clock function, os bar with system command function

#定义变量

url = "" #填写要访问的地址链接

#num = 0 #定义计数的变量

def open (num)

For i in range (num)

num + = 1

Webbrowser.open_new_tab (URL)

Time.sleep (2)

If not num% 10

Od.system ("Killall Firefox")

Open ()



Python Learning Access Script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.