xah icon

web scraper

xah | PRO | 09/30/20 10:20:35 PM UTC (Edited) | 0 ⭐ | 346 👁️ | Never ⏰ | []
Python |

1.24 KB

|

None

|

0 👍

/

0 👎

#! python3
 
import webbrowser, sys, bs4
 
#logs into CKM Scans
 
from twill.commands import *
go('http://ckmscans.halofight.com/login')
 
fv('1', 'username', 'dummyModder')
fv('1', 'password', 'dummyModderPassword')
 
submit('0')
 
print('What novel would you like to edit? "G" for Gu Fang, "W" for the Little Witch.')
novel = input()
 
soup = BeautifulSoup(HTML)
 
if novel == 'G':
    print('Which chapter? 1-75, numerical only.')
    guChapter = int(input())
 
    if guChapter <= 27:
        webbrowser.open('http://ckmscans.halofight.com/f57-gu-fang-bu-zi-shang-01')
        table = soup.find("table")[5]
 
    elif guChapter > 27:
        if guChapter < 55:
            webbrowser.open('http://ckmscans.halofight.com/f56-gu-fang-bu-zi-shang-02')
 
        else:
            webbrowser.open('http://ckmscans.halofight.com/f59-gu-fang-bu-zi-shang-03')
 
    else:
        print('You will have to restart the programme if you got here. My coding isn\'t good enough to help you if you come up with an error.')
 
elif novel == 'W':
    webbrowser.open('http://ckmscans.halofight.com/f54-the-little-witch-s-sure-fire-techniques-01')
 
else:
    print('We don\'t have such a novel. Please either restart if you would like to reload the script.')

Comments