To complete, you can shorten your first XPath with :
(//a[@title][2])[2]/@href
EDIT : Since this XPath fails sometimes, just stick with :
//div[@class='container right']/div[@class='last-five']/a[2]/@href
To select only players (not coaches) and substitutes (who played) you can use :
//div[@class="combined-lineups-container"]//a[@href[contains(.,"players")]][not(parent::p[@class="substitute substitute-out"] or count(ancestor::td/p)=1)]/@href
EDIT :
Here's a WORKBOOK which works with IMPORTXML
or IMPORTFROMWEB
addon (number of requests are limited with the free plan).
First sheet is with IMPORTXML
(one liner). Formula :
=IMPORTXML("https://int.soccerway.com/"&IMPORTXML(C1;"//div[@class='container right']/div[@class='last-five']/a[2]/@href");"//div[@class='combined-lineups-container']//a[@href[contains(.,'players')]]/@href")

Second sheet is with IMPORTHTML
(breakdown in 2 parts). XPath used (get the url, players urls, players who played the match urls) :
//div[@class="container right"]/div[@class="last-five"]/a[2]/@href
//div[@class="combined-lineups-container"]//a[@href[contains(.,"players")]]/@href
//div[@class="combined-lineups-container"]//a[@href[contains(.,"players")]][not(parent::p[@class="substitute substitute-out"] or count(ancestor::td/p)=1)]/@href

Third sheet is with IMPORTHTML
(one liner). Formula used :
=IMPORTFROMWEB("https://int.soccerway.com/"&IMPORTFROMWEB(C1;"//div[@class='container right']/div[@class='last-five']/a[2]/@href");"//div[@class='combined-lineups-container']//a[@href[contains(.,'players')]]/@href")

Alternative if it fails with IMPORTXML
or IMPORTFROMWEB
: IMPORTDATA
+ regexes.

To generate the second url (second url) with the starting url, use something like :
="https://int.soccerway.com"®EXEXTRACT(INDEX(QUERY(IMPORTDATA(A2);"select * WHERE Col1 ENDS WITH '>D</a>' or Col1 ENDS WITH '>W</a>' or Col1 ENDS WITH '>L</a>'");7;1);"href=""(.*?)""")
The QUERY
could be optimized with "matches".
To get the players name (Players v1), use :
=ARRAYFORMULA(REGEXEXTRACT(QUERY(IMPORTDATA(B2);"select Col1 WHERE Col1 STARTS WITH '<a' and Col1 CONTAINS 'flag_16 left' and Col1 CONTAINS 'players'");"href=""(.*?)"""))
You can consult my sheet HERE.
- Cells with blue background contain formulas (mostly ARRAYFORMULA)
- Cells with yellow background : short way to get the data
- Cells with pink background : alternative way to filter the players who really played the match (a bit complicated, could be optimized)
EDIT 2 : "Lineups" sheet has been added to the IMPORTDATA
workbook. That's an example to extract lineups (22 players) for the last 3 matches of home and away team of the start url. Example with : Lugano vs. Basel - 1 July 2020
.

Sometimes, Soccerway doesn't have the lineups. In that case, "no lineups" is returned.