BASH, 111111 108 bytes
a=$(cat)
curl -s https://xkcd.com/$a/ |grep -oP '(?<=Title text:)([^}}]*)'
[ $a = 404 ] && echo "$a not found"
a=$(cat)
curla=#;curl -s https://xkcd.com/$a/ |grep -oP '(?<=Title text:)([^}}]*)'
[';[ $a = 404 ] && echo "$a not found"
To Run:
echo "$number" |change # to number of comic./xkcd Run from command line.sh
Thanks @Ale for the suggestion!