fbscraper/scraper.py
def _getReplies(self,
                    url):
        """routine to extract reples to the comments recursively
        --------------------------------------------------------
        Input:
        :param url: URL of the replies
        """
        self._browser.get(url)
        delay()
        soup = bs(self._browser.page_source, "lxml")
        replyClass = getDivClass(soup)
        divs = getFilteredDivs(soup.findAll("div", class_=replyClass))
        batch = list()
        for div in divs:
            reply = parseReply(div)
            batch.append(reply)
        nRepliesRequired = self._data["nReplies"] - len(self._data["current"])
        nRepliesRequired = min(nRepliesRequired, len(batch))
        if nRepliesRequired == 0:
            return
        self._data["current"].extend(batch[:nRepliesRequired])
        nextLink = getMoreRepliesLink(soup, self._data["commentID"])
        if nextLink is not None:
            try:
                self._getReplies(nextLink)
            except:
                pass
routine to extract reples to the comments recursively
        --------------------------------------------------------
        Input:
        :param url: URL of the replies
        
routine to extract reples to the comments recursively
Input.
routine to extract reples to the comments recursively Input .
def _getReplies(self,
                    url):
        self._browser.get(url)
        delay()
        soup = bs(self._browser.page_source, "lxml")
        replyClass = getDivClass(soup)
        divs = getFilteredDivs(soup.findAll("div", class_=replyClass))
        batch = list()
        for div in divs:
            reply = parseReply(div)
            batch.append(reply)
        nRepliesRequired = self._data["nReplies"] - len(self._data["current"])
        nRepliesRequired = min(nRepliesRequired, len(batch))
        if nRepliesRequired == 0:
            return
        self._data["current"].extend(batch[:nRepliesRequired])
        nextLink = getMoreRepliesLink(soup, self._data["commentID"])
        if nextLink is not None:
            try:
                self._getReplies(nextLink)
            except:
                pass
def _getReplies ( self , url ) : self . _browser . get ( url ) delay ( ) soup = bs ( self . _browser . page_source , "lxml" ) replyClass = getDivClass ( soup ) divs = getFilteredDivs ( soup . findAll ( "div" , class_ = replyClass ) ) batch = list ( ) for div in divs : reply = parseReply ( div ) batch . append ( reply ) nRepliesRequired = self . _data [ "nReplies" ] - len ( self . _data [ "current" ] ) nRepliesRequired = min ( nRepliesRequired , len ( batch ) ) if nRepliesRequired == 0 : return self . _data [ "current" ] . extend ( batch [ : nRepliesRequired ] ) nextLink = getMoreRepliesLink ( soup , self . _data [ "commentID" ] ) if nextLink is not None : try : self . _getReplies ( nextLink ) except : pass
routine to extract reples to the comments recursively
Input:
routine to extract reples to the comments recursively Input :
"""routine to extract reples to the comments recursively
        --------------------------------------------------------
        Input:
        :param url: URL of the replies
        """
self
url
URL of the replies
URL of the replies