Scrape every Java themed codingbat problem set and your personal solutions
Global nomenclature
urlHalf should be URL_HALF. That said, a better name would be DOMAIN, since that's what that string actually is.
Further, after declaring this you don't use it correctly; these:
base_url = &quot;https://codingbat.com&quot;
login_url = &quot;https://codingbat.com/login&quot;
java_url = &quot;https://codingbat.com/java/&quot;

could be
BASE_URL = 'https://' + DOMAIN
LOGIN_URL = BASE_URL = '/login'
JAVA_URL = BASE_URL + '/java'

Input
print(&quot;what is your email&quot;)
inputOne = input(&quot;&gt;&quot;)
print(&quot;password&quot;)
inputTwo = input(&quot;&gt;&quot;)

should not occur at global scope; it should occur in a function. Also, the use of input for passwords is insecure; use getpass instead.
Return parens
These parens:
return(href_array)

are redundant.
Generator
link_array = []
for directory in directories:
    # ...
    link_array.append(links)
return(link_array)

can simply be
for directory in directories:
    # ...
    yield links

or, if you want a &quot;flattened&quot; output that does not have nested lists, use yield from links.
File extensions
Does this file:
f = open('answers/answers.java', 'w')

actually receive Java code? It seems not, in which case - use just .txt.