'Turn digits before a certain character into a separate object

I have an object defined as some numbers, a forward slash surrounded by spaces and then also some numbers, and I want to turn the digits before the forward slash into a separate object. Here are some examples:

4026 / 1769395
5160 / 1769395
5158 / 1769395

The examples are the content of different cells in an HTML table that I got by using this code ('curver' and 'curcol' are variables defining the verse and column of the cell that is in use):

cellcontent = driver.find_element_by_xpath('/html/body/div/table[8]/tbody/tr[' + str(curver - 3) +']/td[' + str(curcol + 1) + ']').text

print(cellcontent)

I know that it looks like the easier approach is to just include only the first four digits, or include everything except the last 10 digits, but the examples look like this because of the dataset I'm testing the code with. Sometimes there can be less or more digits in the first or the second number.

How can I include only the numbers before a space and a forward slash?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source