Which Beautiful Soup version is included in XBMC
#1
According to the Wiki the version should be 3.2.0. I was wondering if this is correct? Because version 4 is released for some time.

If version 3.2.0 is included in XBMC, does anyone know if it will be upgraded?
Reply
#2
wanted to update it within some time but need to know if there are any drawbacks for current addons as it needs to be backwards compatible
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#3
@all
please give it a try so i know if it can be updated safely
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#4
(2013-09-24, 19:21)markdark Wrote: According to the Wiki the version should be 3.2.0. I was wondering if this is correct? Because version 4 is released for some time.

If version 3.2.0 is included in XBMC, does anyone know if it will be upgraded?

it's not possible to upgrade as bs4 is not backward compatible with beautifulsoup 3.
but, if there's a need for bs4, it can be added as a separate module tough.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
OK, I just started writing some code with Beautiful Soup. I will start building in version 3.
Reply
#6
will look at adding bs4 as separate module for people who want it
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#7
Beautifulsoup 3.3.1

https://dl.dropboxusercontent.com/u/7435...-3.2.1.zip
install .zip and use this import in your addon

addon.xml
PHP Code:
<import addon="script.module.beautifulsoup" version="3.2.1"/> 

python code:
PHP Code:
from BeautifulSoup import BeautifulSoup 


Beautifulsoup 4.3.1
not entirely compatible with 3.2.1 so will be added as separate module
https://dl.dropboxusercontent.com/u/7435...-4.3.1.zip
install .zip and use this import in your addon

addon.xml
PHP Code:
<import addon="script.module.beautifulsoup4" version="4.3.1"/> 

python code
PHP Code:
from bs4 import BeautifulSoup 

please test these if possible.
if these work i will push them to Frodo repo.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#8
I just started creating some Python script because some site scrapers don't work that well. But still have to find out howto create a plugin / add-on for XBMC. Here is the scraper Python script I have so far. Using Beautiful Soup 3.2:

Code:
# Import the classes that are needed
import urllib2
from BeautifulSoup import BeautifulSoup

# URL to scrape and open it with the urllib2
url = 'http://www.wiziwig.tv/competition.php?competitionid=92&part=sports&discipline=football'
source = urllib2.urlopen(url)

# Turn the saved source into a BeautifulSoup object
soup = BeautifulSoup(source)

# Find all <tr> elements that contain the matches, skip the rows with the home team text 'Dutch KNVB Beker'
# Join the times together...
for tr in soup.findAll('tr', {'class': ['odd', 'even']}):
    home_team = tr.find('td', {'class': 'home'}).text
    if home_team == 'Dutch KNVB Beker':
        continue

    date = tr.find('div', {'class': 'date'}).text
    time = ' - '.join([span.text for span in tr.findAll('span', {'class': 'time'})])
    away_team = tr.find('td', {'class': 'away'}).text
    broadcast = tr.find('a', {'class': 'broadcast'})['href']

    print date, time, home_team, away_team, broadcast

And finally the next for scraping the streams:

Code:
# Import the classes that are needed
import urllib2
from BeautifulSoup import BeautifulSoup

# URL to scrape and open it with the urllib2
url = 'http://www.wiziwig.tv/broadcast.php?matchid=219751&part=sports'
source = urllib2.urlopen(url)

# Turn the saved source into a BeautifulSoup object
soup = BeautifulSoup(source)

stationName = ''
for tr in soup.findAll('tr', {'class': ['broadcast', 'streamrow even', 'streamrow odd']}):
    if tr['class'] == 'broadcast':
        stationName = tr.findAll('td')[1].text
    else:
        kindStream = tr.findAll('td')[0].text
        streamBitrate = tr.findAll('td')[2].text
        streamStrength = tr.find('div', {'class': 'rating'})['rel']
        streamUrl = tr.find('a', {'class': 'broadcast go'})['href']

        print stationName, kindStream, streamBitrate, streamStrength, streamUrl

Everything is now still static, but will work on the XBMC plugin. Maybe someone can test with this code or if he his some other code.
Reply

Logout Mark Read Team Forum Stats Members Help
Which Beautiful Soup version is included in XBMC0