facebook-scraper icon indicating copy to clipboard operation
facebook-scraper copied to clipboard

get if not url.startswith("http"): returns AttributeError

Open u3533791 opened this issue 2 years ago • 1 comments

Error message:

line 780, in get if not url.startswith("http"):

AttributeError: 'int' object has no attribute 'startswith'

I applied a hot fix as such and it worked:

    def get(self, url, **kwargs):
        if type(url) == int:          #ADDED THIS LINE
            url = str(url)          #ADDED THIS LINE
        try:
            if not url.startswith("http"):
                url = utils.urljoin(FB_MOBILE_BASE_URL, url)

u3533791 avatar Mar 18 '22 17:03 u3533791

Sounds good - committed here - https://github.com/kevinzg/facebook-scraper/commit/6e621127bd4e040b759bc880e4c4d53eea4b4c09

neon-ninja avatar Mar 30 '22 02:03 neon-ninja