D
D
del4pp2020-04-02 22:42:02
Python
del4pp, 2020-04-02 22:42:02

BS4 does not see new videos, how to fix?

When a video appears on the channel I need, bs4 does not see it for some reason. Here is the code

def parseYoutubeChanel(channelurl):
    urlPage = urlopen(channelurl)
    xmlData = urlPage.read().decode('utf-8')
    new_video = BeautifulSoup(xmlData, 'lxml')
    for lnk in new_video.findAll('a', href=True):
        linkspage = lnk['href']
        startLink = linkspage[:6]
        if startLink == '/watch':
            newLink = 'http://youtube.com' + linkspage
            listvideoUrlLink.append(newLink)


Runs every 10 seconds.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-04-02
@dimonchik2013

debug prints
check on another channel

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question