Skip to content

Forbes articles don't work. #2

Description

@fergyfresh

I was using BeautifulSoup to scrape through a Forbes article to pull out the text until I realized Alchemy has an API to do this. I was running into an annoying scenario where the landing page for any forbes article is the forbes/home page with a 'Continue 3..2..1' displayed on the page. I was able to work around that, but it seems that your API doesn't. Can I feed the raw html from BeautifulSoup to an API call on your end? This would be my quickest workaround. I will be reading the API docs but currently this is what happens.

from alchemyapi import AlchemyAPI
import json

# Create the AlchemyAPI Object
alchemyapi = AlchemyAPI()

# Create demo url which will be user input later
demo_url = 'http://www.forbes.com/sites/laurashin/2015/09/09/bitcoins-shared-ledger-technology-moneys-new-operating-system/'

# Created response object from input url
response = alchemyapi.text('url', demo_url)

if response['status'] == 'OK':
    print('## Response Object ##')
    print(json.dumps(response, indent=4))

    print('')
    print('## Text ##')
    print('text: ', response['text'].encode('utf-8'))
    print('')
else:
    print('Error in text extraction call: ', response['statusInfo'])

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions