-1

I am trying to make a discord bot using python for my friend’s Warframe clan that scrapes content from the Warframe PC Announcements section. I was wanting to use the discord bot to send it as an Embed in the Discord Chat

Here is some code I have tried


import urllib
from bs4 import BeautifulSoup
import lxml


url = "http://forums.warframe.com/forum/2-pc-announcements/?sortby=start_date&sortdirection=desc"
from bs4 import BeautifulSoup
import requests
import lxml
sess = requests.Session()
page = sess.get(url)
page = BeautifulSoup(page.text, features="lxml")
soap = page.select('li.item', features="lxml")
print([s.find('li').text for s in soap])


thedankboi
  • 53
  • 1
  • 8

1 Answers1

0

Although your title asks one thing, your question asks another.

To get content from an ordered list:

for item in ordered_list:

    # This is where you would do things to your item
    new_thing = foo(item)

    return new_thing

To get content from an ordered list and pass the index:

for idx, item in enumerate(ordered_list):

    # This is where you would do things to your item
    new_thing = foo(item)

    return idx, new_thing

As for the body of your question. You state that everything I've tried has failed, what exactly have you tried though?

Well I can't tell you how to do this, I can point you towards topics that will help:


If you give more information the community can provide better answers.


Darien Schettler
  • 546
  • 4
  • 13