He preyed on vulnerable woman who had been drinking late at night and continued to offend after being released on bail charged with four offences of rape.
Leeds Crown Court heard was shown "harrowing" CCTV footage of him removing a victim's clothing before forcing her to the ground and carrying out the sex attack.
Prosecutor Phillip Standfast described the offences at Leeds Crown Court.
The list of offences - when and where they happened
Offence Number One. Rape. Wakefield, February 6, 2014.
Hartley, of Summerfield Green, Rodley, Leeds targeted his first victim in Wakefield city centre on February 6, 2014.
The victim had been drinking in the Strafford Arms where she had a row with her boyfriend and he had left her in the pub.
The woman stayed in the pub alone for around an hour but then headed to her partner's home to "patch things up".
Hartley attacked her as she walked along Stanley Road.
The woman was knocked to the ground and banged her head on the ground.
Hartley managed to remove her clothing as she was on the ground and carried out the sex attack.
The rapist put his hand over her mouth as she tried to scream for help.
Hartley fled after being disturbed by the landlord of the Albion pub who was walking his dog.
The victim's clothing was later analysed and found to contain Hartley's DNA.
He was arrested in connection with the attack in November 2014 but denied the offence, claiming the woman had consented to sex.
In a victim statement read to the court by the prosecutor, the woman described the trauma of having to take mediation to reduce the risk of sexual transmitted infection.
She has been able to return to work since the attack and has moved away from Wakefield.
She said: "The issue has had an effect on every area of my life.
"Prior to the incident I was confident, bubbly and outgoing. Now I am exactly the opposite."
Offence Number Two. Rape. Wakefield, May 17, 2014
Hartley raped the 20-year-old victim in an alleyway behind Wakefield Prison in an attack that was caught on a security camera.
The defendant had approached the woman earlier in the evening when she was in Tequila nightclub but was told to go away by one of her friends.
Hartley waited outside the nightclub and followed her when she left alone and began talking to her.
Mr Standfast said the victim was "feeling low" and thought Hartley was being nice to her.
He said: "He asked her to be his girlfriend but she said no because she had only just met him."
The court was shown footage of Hartley and the woman kissing before he removed her clothing as she tried to stop him.
During the sex attack Hartley pulled the woman's hair and called her a "slag"
Afterwards she got dressed and attacked Hartley, aiming punches at him and scratching his face.
The prosecutor said: "The defendant did not appear to recognise what he had done."
Police were called to the area and found the victim walking along Westgate, where she immediately told officers she had been raped.
In victim statement said said: "Looking back, he targeted me and gained my trust. I can see how he planned to attack me from being inside that bar."
Offence Number Three. Leeds, July 1, 2017.
Hartley attacked his victim in her own home in Leeds after knocking on the door and offering to do gardening work.
The woman agreed that Hartley could cut the hedges in her garden for Â£20.
He was allowed into part of the house to plug his tools in but followed her into the kitchen and grabbed her.
Hartley tried to kiss the woman but she refused and told him she had a boyfriend.
He then put his hand inside her underwear but she managed to pull away from him.
The defendant then exposed himself to the woman and she it was "her fault".
The victim's three-year-old daughter came into the room and was picked up by her mother but Hartley tried to grab her and asked the woman to sleep with him.
Mr Standfast said: "Her daughter, who saw some of what was going on said he wasn't to kiss her mummy and only her dad should do that."
Hartley continued to try to kiss the woman before leaving the property.
The victim described how she had suffered from depression and anxiety since the incident.