my URL is this
https://en.wikipedia.org/wiki/List_of_South_Korean_dramas
This works well in selecting all links from for A to Z.
link = s.get(url)
link_soup = BeautifulSoup(link.text, 'lxml')
links = (
link_soup
.select_one('#A')
.parent
.find_next_sibling("ul")
.find_all("a", href=True)
)
But when I try to select_one #0-9
....
link_soup
.select_one('#0-9')
.parent
.find_next_sibling("ul")
.find_all("a", href=True)
)
I get this error
SelectorSyntaxError: Malformed id selector at position 0
line 1:
#0-9
^
How can I select only the links from "#0-9 and A-Z"? I know I can just use a for loop and use re to change the ending of the URL and manually scrape the links from there but is there a way to get the same results using select or bs4.
Thanks again for the help.