Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
Guovin committed Feb 6, 2024
1 parent 95cb03f commit 1486719
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from selenium import webdriver
import time
from selenium.webdriver.common.by import By
import os
import re
import requests
from selenium_stealth import stealth
Expand Down Expand Up @@ -60,7 +59,7 @@ def getChannelItems(self):

def outputTxt(self,cate,channelUrls):
# 创建一个新的final文件
with open('result.txt', 'r') as f:
with open(self.finalFile, 'w', encoding='utf-16') as f:
for name, urls in channelUrls.items():
f.write(cate + ',#genre#\n')
for url in urls:
Expand Down Expand Up @@ -90,13 +89,8 @@ def compareSpeed(self,pageUrls):

return pageUrls_new

def removeFile(self):
if os.path.exists(self.finalFile):
os.remove(self.finalFile)

def visitPage(self,channelItems):
self.driver.get("https://www.foodieguide.com/iptvsearch/")
self.removeFile()
for cate, names in channelItems.items():
channelUrls = {}
for name in names:
Expand Down

0 comments on commit 1486719

Please sign in to comment.