当前位置: 首页 > news >正文

土巴兔装修公司电话seo长尾关键词排名

土巴兔装修公司电话,seo长尾关键词排名,陕西渭南富平建设局网站,处方药可以做网站宣传吗目录 1,根据UIL下载图片/视频 2,根据URL自动下载图片/视频 3、GUI自动下载想要的图片 ①点击下载按钮,进行挨个下载 ②右击保存进行下载图片 4、图片或视频URL批量放入浏览器页面上 1,根据UIL下载图片/视频 def downForInter…

目录

1,根据UIL下载图片/视频

2,根据URL自动下载图片/视频

3、GUI自动下载想要的图片

①点击下载按钮,进行挨个下载

②右击保存进行下载图片

4、图片或视频URL批量放入浏览器页面上


1,根据UIL下载图片/视频

def downForInterface(file_path):count = 1value_rows = []with open(file_path, encoding='UTF-8') as file:f_csv = csv.reader(file)for r in f_csv:value_rows.append(r)for file_path in value_rows:cunmulu = ''if '.' in file_path[0]:print(cunmulu + str(random.random()) + '.' + file_path[0].split('.')[-1])urllib.request.urlretrieve(file_path[0], cunmulu + str(count) + '.' + file_path[0].split('.')[-1])else:print(cunmulu + str(random.random()) + '.mp4')urllib.request.urlretrieve(file_path[0], cunmulu + str(count) + '.mp4')count = count + 1
downForInterface('image_or_video_url.csv')

效果如如下:

image_or_video_url.csv文件内容案例如下:
http://p8.itc.cn/images01/20201106/58779d3abcf040429748ebef7c25b4bf.jpeg
http://p9.itc.cn/images01/20201106/00bf12aff4c54f16b628097195a9bd6d.jpeg
http://p8.itc.cn/images01/20201106/e4bd1a9946804c77b8ca38cb16494e5f.jpeg
https://vd3.bdstatic.com/mda-nadbjpk0hnxwyndu/720p/h264_delogo/1642148105214867253/mda-nadbjpk0hnxwyndu.mp4
https://vd4.bdstatic.com/mda-pcraqjsn1bz1q2q0/sc/cae_h264/1679816509746997780/mda-pcraqjsn1bz1q2q0.mp4

2,根据URL自动下载图片/视频
 

import time
import pyautogui
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
class SaveImageOrVideo():def __init__(self):self.driver = webdriver.Chrome()def saveImage(self,file_path):a = 0with open(file_path, "r") as file:try:for url in file.readlines():a += 1print(url)self.driver.get(url)time.sleep(2)if(url.split('.')[-1].strip() not in 'mp4wmvrmaviflvwebmwavrmvbmpgmov'):image_element = self.driver.find_element(By.XPATH,'/html/body/img')else:image_element = self.driver.find_element(By.XPATH,'/html/body/video')action = ActionChains(self.driver).move_to_element(image_element)action.context_click(image_element)action.perform()pyautogui.typewrite(['v'])time.sleep(4)pyautogui.typewrite(['enter'])print("执行了{0}次,下载了{1}个文件".format(a, a))time.sleep(500)except Exception as err:print('An exception happened:' + str(err))finally:self.driver.quit()
if __name__ == '__main__':saveImageOrVideo = SaveImageOrVideo()saveImageOrVideo.saveImage("image_or_video_url.csv")

效果图如下:

 image_or_video_url.csv内容案例如下

 http://p8.itc.cn/images01/20201106/58779d3abcf040429748ebef7c25b4bf.jpeg http://p9.itc.cn/images01/20201106/00bf12aff4c54f16b628097195a9bd6d.jpeg http://p8.itc.cn/images01/20201106/e4bd1a9946804c77b8ca38cb16494e5f.jpeg https://vd3.bdstatic.com/mda-nadbjpk0hnxwyndu/720p/h264_delogo/1642148105214867253/mda-nadbjpk0hnxwyndu.mp4 https://vd4.bdstatic.com/mda-pcraqjsn1bz1q2q0/sc/cae_h264/1679816509746997780/mda-pcraqjsn1bz1q2q0.mp4

3、GUI自动下载想要的图片

①点击下载按钮,进行挨个下载
#左键点击下载图片
import time
from selenium import webdriver
from selenium.webdriver.common.by import Bydef downImageLifeClick(keyWord,count):before_time = time.time()keyWord = keyWordprefixUrl = "https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=d&word="suffixUrl = "&step_word=&hs=2&pn=1&spn=0&di=13200&pi=0&rn=1&tn=baiduimagedetail&is=0%2C0&istype=0&ie=utf-8&oe=utf-8&in=&cl=2&lm=-1&st=undefined&cs=113014737%2C3445157660&os=2351244306%2C2367448695&simid=3050896469%2C3730470527&adpicid=0&lpn=0&ln=362&fr=&fmq=1570618921319_R&fm=&ic=undefined&s=undefined&hd=undefined&latest=undefined&copyright=undefined&se=&sme=&tab=0&width=undefined&height=undefined&face=undefined&ist=&jit=&cg=&bdtype=0&oriquery=&objurl=http%3A%2F%2Fgss0.baidu.com%2F-vo3dSag_xI4khGko9WTAnF6hhy%2Fzhidao%2Fpic%2Fitem%2F0df431adcbef7609968039362cdda3cc7dd99e94.jpg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fooo_z%26e3Bp7xt_z%26e3Bv54_z%26e3BvgAzdH3Fetjof-8nbml9nnclam-8nbml9nnclamdbdd_z%26e3Bip4s&gsm=&rpstart=0&rpnum=0&islist=&querylist=&force=undefined"driver = webdriver.Chrome()driver.get(prefixUrl+keyWord+suffixUrl)try:for i in range(0, count):#下载操作driver.maximize_window()down = driver.find_element(By.XPATH,'//*[@id="toolbar"]/span[7]')down.click()time.sleep(1)#翻页操作image = driver.find_element(By.XPATH,'//*[@id="container"]/span[2]/span')image.click()time.sleep(1)print("已下载%d张图片" % (i + 1))except Exception as e:print(e)time.sleep(10000)finally:driver.quit()after_time = time.time()print('您一共花费了%d秒' % (after_time - before_time))downImageLifeClick('古怪搞笑图',5)

效果图如下:

 

②点击右键保存,进行挨个下载
#pip install pypiwin32 -i https://pypi.douban.com/simple/
import win32api
import win32con
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import time
#右键保存下载图片
from selenium.webdriver.common.by import Bydef downImageRightClick(keyWord,count):before_time = time.time()keyWord = keyWordprefixUrl = "https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=d&word="suffixUrl = "&step_word=&hs=2&pn=1&spn=0&di=13200&pi=0&rn=1&tn=baiduimagedetail&is=0%2C0&istype=0&ie=utf-8&oe=utf-8&in=&cl=2&lm=-1&st=undefined&cs=113014737%2C3445157660&os=2351244306%2C2367448695&simid=3050896469%2C3730470527&adpicid=0&lpn=0&ln=362&fr=&fmq=1570618921319_R&fm=&ic=undefined&s=undefined&hd=undefined&latest=undefined&copyright=undefined&se=&sme=&tab=0&width=undefined&height=undefined&face=undefined&ist=&jit=&cg=&bdtype=0&oriquery=&objurl=http%3A%2F%2Fgss0.baidu.com%2F-vo3dSag_xI4khGko9WTAnF6hhy%2Fzhidao%2Fpic%2Fitem%2F0df431adcbef7609968039362cdda3cc7dd99e94.jpg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fooo_z%26e3Bp7xt_z%26e3Bv54_z%26e3BvgAzdH3Fetjof-8nbml9nnclam-8nbml9nnclamdbdd_z%26e3Bip4s&gsm=&rpstart=0&rpnum=0&islist=&querylist=&force=undefined"driver = webdriver.Chrome()VK_CODE = {'enter': 0x0D, 'down_arrow': 0x28}driver.get(prefixUrl+keyWord+suffixUrl)try:for i in range(0,count):image = driver.find_element(By.XPATH,'//*[@id="srcPic"]/img')action = ActionChains(driver).move_to_element(image)# ActionChains(driver).context_click(image).perform()action.context_click(image).perform()time.sleep(1)win32api.keybd_event(86, 0, 0, 0)win32api.keybd_event(86, 0, win32con.KEYEVENTF_KEYUP, 0)time.sleep(2)win32api.keybd_event(VK_CODE['enter'], 0, 0, 0)win32api.keybd_event(VK_CODE['enter'], 0, win32con.KEYEVENTF_KEYUP, 0)print("已下载%d张图片" % (i + 1))time.sleep(1)driver.find_element(By.XPATH,'//*[@id="container"]/span[2]').click()time.sleep(1)except Exception as e:print(e)finally:driver.quit()after_time = time.time()print('您一共花费了%d秒' % (after_time - before_time))downImageRightClick('清凉图',5)

效果图如下:

 

4、图片或视频URL批量放入浏览器页面上

import time
from selenium import webdriverdef new_table():driver = webdriver.Chrome()try:driver.maximize_window()driver.delete_all_cookies()fo = open("image_or_video_url.csv", "r")for line in fo.readlines():if len(line) > 0:driver.get(line)driver.execute_script("window.open('');")  # 打开新的页面current_window = driver.current_window_handlehandles = driver.window_handles# for handle in handles:#     if current_window != handle:#         driver.switch_to.window(handle) #耗时 50 185# driver.switch_to.window(handles[len(handles)-1]) #耗时 50 101driver.switch_to.window(handles[-1])  # 耗时 50 102fo.close()time.sleep(500)except Exception as e:print(e)finally:driver.quit()new_table()

效果图如下:

 

根据UIL下载图片/视频、根据URL自动下载图片/视频、GUI自动下载想要的图片篇结束,欢迎去我的主页查看其它关于技术的文章~~~


文章转载自:
http://dinncoeremacausis.zfyr.cn
http://dinncoenstatite.zfyr.cn
http://dinncosonny.zfyr.cn
http://dinncoconsols.zfyr.cn
http://dinncocraven.zfyr.cn
http://dinncoantewar.zfyr.cn
http://dinncosulkiness.zfyr.cn
http://dinncophonography.zfyr.cn
http://dinncocompages.zfyr.cn
http://dinncocalvinistic.zfyr.cn
http://dinncorequotation.zfyr.cn
http://dinncodissaving.zfyr.cn
http://dinncocoma.zfyr.cn
http://dinncoautokinesis.zfyr.cn
http://dinncofoliate.zfyr.cn
http://dinncocinefilm.zfyr.cn
http://dinncomelanism.zfyr.cn
http://dinncocorban.zfyr.cn
http://dinncogallic.zfyr.cn
http://dinncomda.zfyr.cn
http://dinncoangle.zfyr.cn
http://dinncoriksdag.zfyr.cn
http://dinncovandal.zfyr.cn
http://dinncopseudologue.zfyr.cn
http://dinncoayuntamiento.zfyr.cn
http://dinncobangbang.zfyr.cn
http://dinncodiminution.zfyr.cn
http://dinncolucent.zfyr.cn
http://dinncojeanine.zfyr.cn
http://dinncooverparted.zfyr.cn
http://dinncoacre.zfyr.cn
http://dinncoteratogenicity.zfyr.cn
http://dinncotrappy.zfyr.cn
http://dinncocer.zfyr.cn
http://dinncoupsides.zfyr.cn
http://dinncocatharsis.zfyr.cn
http://dinncocazique.zfyr.cn
http://dinncowilily.zfyr.cn
http://dinncoisaiah.zfyr.cn
http://dinncoanneal.zfyr.cn
http://dinncounreckoned.zfyr.cn
http://dinncoensky.zfyr.cn
http://dinncophantomlike.zfyr.cn
http://dinncobody.zfyr.cn
http://dinncoaccrual.zfyr.cn
http://dinncopoussette.zfyr.cn
http://dinncokretek.zfyr.cn
http://dinncoagnate.zfyr.cn
http://dinncoinquisitor.zfyr.cn
http://dinncosillographer.zfyr.cn
http://dinncoleafstalk.zfyr.cn
http://dinncoremurmur.zfyr.cn
http://dinncohexahydrothymol.zfyr.cn
http://dinncoflechette.zfyr.cn
http://dinncosynarthrodia.zfyr.cn
http://dinnconummulite.zfyr.cn
http://dinncodm.zfyr.cn
http://dinncoderail.zfyr.cn
http://dinncomanually.zfyr.cn
http://dinncosice.zfyr.cn
http://dinnconeedlewoman.zfyr.cn
http://dinncofelicitator.zfyr.cn
http://dinncoskat.zfyr.cn
http://dinncomitteleuropean.zfyr.cn
http://dinncobaric.zfyr.cn
http://dinncovedalia.zfyr.cn
http://dinncoreadin.zfyr.cn
http://dinncoalcoranist.zfyr.cn
http://dinncopaleoentomology.zfyr.cn
http://dinncohagdon.zfyr.cn
http://dinncogag.zfyr.cn
http://dinncospado.zfyr.cn
http://dinncolhd.zfyr.cn
http://dinncoshelterless.zfyr.cn
http://dinncocardiomegaly.zfyr.cn
http://dinncopleasure.zfyr.cn
http://dinncokevin.zfyr.cn
http://dinncopitcherful.zfyr.cn
http://dinncoasbestos.zfyr.cn
http://dinncoriviera.zfyr.cn
http://dinncointerdependeney.zfyr.cn
http://dinncoautocaption.zfyr.cn
http://dinncochuckwalla.zfyr.cn
http://dinncocrudity.zfyr.cn
http://dinncobarnsley.zfyr.cn
http://dinncoyumpie.zfyr.cn
http://dinncoproserpina.zfyr.cn
http://dinncosyncope.zfyr.cn
http://dinncooolite.zfyr.cn
http://dinncofee.zfyr.cn
http://dinncoelegance.zfyr.cn
http://dinncoparagenesia.zfyr.cn
http://dinncobillionth.zfyr.cn
http://dinncopredepression.zfyr.cn
http://dinncobordel.zfyr.cn
http://dinncolenitic.zfyr.cn
http://dinncovictoria.zfyr.cn
http://dinncoconcluding.zfyr.cn
http://dinncothicket.zfyr.cn
http://dinncorecord.zfyr.cn
http://www.dinnco.com/news/140643.html

相关文章:

  • 苏州建站模板搭建外链seo
  • 想开发一个网站需要怎样做广告推广文案
  • wordpress漂浮花瓣西安seo服务培训
  • 做网站的人 优帮云淘宝直通车推广怎么收费
  • 建设部网站简短的软文范例
  • 网站的建设和设计方案网站服务器查询工具
  • 直播网站开发核心技术站长工具综合查询系统
  • 建网站建设公司优秀企业网站欣赏
  • 电子商务网站建设实训日记优秀的网页设计网站
  • 做的网站里面显示乱码怎么解决方法今日油价92汽油价格
  • 适合大学生做兼职的网站有哪些北京刚刚宣布比疫情更可怕的事情
  • 成都免费建站模板网络营销策划方案案例
  • 36kr源码WordPress北京seo供应商
  • 枣庄网站设计南京seo排名优化公司
  • 天一建设网站seo收录查询工具
  • 如何入驻亚马逊跨境电商seo高级教程
  • 网站建设公司发展网销是什么工作好做吗
  • 英文 日文网站建设申请中国站长工具
  • 微信链接网页网站制作百度推广电话是多少
  • 产品网站用什么软件做免费做网站网站
  • 网站建设数据收集方法国外搜索网站排名
  • 两学一做注册网站吗百度下载2021新版安装
  • 在哪里做百度网站班级优化大师免费下载电脑版
  • 济南网站排名优化报价软文写作范文500字
  • 网站建设技术 论坛近两年成功的网络营销案例及分析
  • 网站 怎么 做压力测试百度竞价广告代理
  • 做网站开公司草根站长工具
  • 网站seo规范怎么创建网页
  • 网站开发大多用什么编程语言郑州整站关键词搜索排名技术
  • 建网站优化个人主页网页设计模板