Hi, I have written a short program that will scrape a given
website for img src that have their attribute tag with id="marked".
The program works, but I am not quiet sure which attributes to
make private.

Here is the code.

import urllib
from BeautifulSoup import *

class ImgScrape(object):
    def __init__(self):
        self.count = 0
        self.__results = []

    def scrape(self, url):
        self.__html = urllib.urlopen(url)
        self.__soup = BeautifulSoup(self.__html)
        for img in self.__soup.findAll(id="marked"):
            self.count += 1
            self.__results.append(img['src'])
        return self.__results

the attributes which you don't want outside to have access to.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.